From 4fa613cf4dd93c131561932c1277599ab99ce4e5 Mon Sep 17 00:00:00 2001 From: Georgios Atheridis Date: Wed, 2 Nov 2022 19:08:55 +0000 Subject: [PATCH] implemented 0 position to always show who plays with, removed DST --- skgyorugo/auto_messages/give_permission.py | 2 +- skgyorugo/auto_messages/latege.py | 2 +- skgyorugo/commands/Q.py | 6 +++--- skgyorugo/commands/latege.py | 2 +- skgyorugo/commands/opgg.py | 17 ++++++++++++++++- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/skgyorugo/auto_messages/give_permission.py b/skgyorugo/auto_messages/give_permission.py index f85bc9b..2347876 100644 --- a/skgyorugo/auto_messages/give_permission.py +++ b/skgyorugo/auto_messages/give_permission.py @@ -1,6 +1,6 @@ from aptbot.bot import Message, Commands, Bot -COOLDOWN = 60 * 60 +COOLDOWN = 120 * 60 END_TIME = 0 diff --git a/skgyorugo/auto_messages/latege.py b/skgyorugo/auto_messages/latege.py index 52fbf15..3011a2d 100644 --- a/skgyorugo/auto_messages/latege.py +++ b/skgyorugo/auto_messages/latege.py @@ -6,7 +6,7 @@ import tools.smart_start_stream_time COOLDOWN = 180 END_TIME = COOLDOWN * 5 -STREAM_SCHEDULE = dt.time(17, 30) +STREAM_SCHEDULE = dt.time(18, 30) def main(bot: Bot, message: Message): diff --git a/skgyorugo/commands/Q.py b/skgyorugo/commands/Q.py index 282e530..b7f4fd0 100644 --- a/skgyorugo/commands/Q.py +++ b/skgyorugo/commands/Q.py @@ -110,7 +110,7 @@ def main(bot: Bot, message: Message): reply=message.tags["id"], ) - play_list = [user.display_name for user in queue_users[1:queue_size]] + play_list = [user.display_name for user in queue_users[0:queue_size]] prio_queue = [] wait_list = [] for user in queue_users[queue_size:]: @@ -121,9 +121,9 @@ def main(bot: Bot, message: Message): wait_list.append(user.display_name) if prio_queue: - msg = f"These people are playing with {message.channel}: {play_list} | These people are in Priority Queue: {prio_queue} | These people are in the Wait List: {wait_list}." + msg = f"These people are playing with {play_list[0]}: {play_list[1:]} | These people are in Priority Queue: {prio_queue} | These people are in the Wait List: {wait_list}." else: - msg = f"These people are playing with {message.channel}: {play_list} | These people are in the Wait List: {wait_list}." + msg = f"These people are playing with {play_list[0]}: {play_list[1:]} | These people are in the Wait List: {wait_list}." if unavailable_users: msg += f" | These people are also not here: {unavailable_users}." diff --git a/skgyorugo/commands/latege.py b/skgyorugo/commands/latege.py index 7eae204..71732d2 100644 --- a/skgyorugo/commands/latege.py +++ b/skgyorugo/commands/latege.py @@ -9,7 +9,7 @@ DESCRIPTION = "" USER_COOLDOWN = 15 GLOBAL_COOLDOWN = 5 -STREAM_SCHEDULE = dt.time(17, 30) +STREAM_SCHEDULE = dt.time(18, 30) def main(bot: Bot, message: Message): diff --git a/skgyorugo/commands/opgg.py b/skgyorugo/commands/opgg.py index 420a0d0..6964cd9 100644 --- a/skgyorugo/commands/opgg.py +++ b/skgyorugo/commands/opgg.py @@ -60,6 +60,12 @@ def main(bot: Bot, message: Message): (twitch_id,), ) fetched = c.fetchall() + c.execute( + """ + SELECT twitch_id, summoner_id FROM accounts; + """, + ) + fetched_all = c.fetchall() if not fetched: smart_privmsg.send( @@ -89,10 +95,19 @@ def main(bot: Bot, message: Message): conn.close() return + play_with = [] + for summoner in info.participants: + for f in fetched_all: + if summoner.summoner_id == f[1] and summoner.summoner_id != fetched[0][0]: + play_with.append(ttv_api.users.get_users(user_ids=[f[0]])[0].display_name), + break + msg = f"{twitch_user} is currently playing a game on: {summoner_names[-1]}" + if play_with: + msg += f" and is playing with {play_with}." smart_privmsg.send( bot, message, - f"{twitch_user} is currently playing a game on: {summoner_names[-1]}", + msg, reply=message.tags["id"], ) conn.close() -- 2.30.2