From b258a8fe65639689336cb34d2bce818988fbbfd1 Mon Sep 17 00:00:00 2001 From: Georgios Atheridis Date: Fri, 6 May 2022 14:38:25 +0000 Subject: [PATCH] added latege command --- skgyorugo/commands/latege.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 skgyorugo/commands/latege.py diff --git a/skgyorugo/commands/latege.py b/skgyorugo/commands/latege.py new file mode 100644 index 0000000..7cfa1ae --- /dev/null +++ b/skgyorugo/commands/latege.py @@ -0,0 +1,33 @@ +from aptbot.bot import Message, Commands, Bot +import tools.smart_start_stream_time +from datetime import datetime +import datetime as dt + +PERMISSION = 99 +PREFIX = '?' +DESCRIPTION = "" +USER_COOLDOWN = 15 +GLOBAL_COOLDOWN = 5 + +STREAM_SCHEDULE = dt.time(17, 30) + +def main(bot: Bot, message: Message): + start_stream_ts = tools.smart_start_stream_time.start_stream_timestamp() + if not start_stream_ts: + return + start_stream_dt = datetime.utcfromtimestamp(start_stream_ts) + stream_schedule_dt = datetime.combine(datetime.utcfromtimestamp(start_stream_ts), STREAM_SCHEDULE) + latege_amount = (start_stream_dt - stream_schedule_dt).total_seconds() + if latege_amount > 45 * 60: + msg = f"{message.channel} is so Latege he might as well have not \ + streamed today. At least he's early for tomorrow COPIUM . \ + {message.channel} is Latege by {latege_amount} seconds Madge" + elif latege_amount > 0: + msg = f"{message.channel} is Latege by {latege_amount} seconds again Madge" + elif latege_amount == 0: + msg = f"Amazing!!! {message.channel} is EXACTLY on time today POGGERS" + else: + msg = f"UNBELIEVABLE!!!!! {message.channel} is EARLY by {-latege_amount} seconds!!!!\ + This has NEVER happened before POGGERS" + bot.send_privmsg(message.channel, msg) + -- 2.30.2