From dd4c7e7fe0f526b2e36238b598db533ee6d11051 Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Sat, 29 Jan 2022 18:47:28 +0100 Subject: [PATCH] fix error in stop command coming from timezone addition --- bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index b4a3444..a1ea94e 100644 --- a/bot.py +++ b/bot.py @@ -254,13 +254,13 @@ async def start(ctx, role_id): @bot.command(help="Beende die gestartete Runde PnP", usage="") @is_gm() async def stop(ctx): - #await ctx.message.delete() + await ctx.message.delete() text_file = open("start_id.txt", "r") start_id = text_file.read() text_file.close() start_msg = await bot.get_channel(435501602485305345).fetch_message(start_id) - now_time = datetime.datetime.utcnow().replace(microsecond=0) - then_time = start_msg.created_at.replace(microsecond=0) + now_time = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc) + then_time = start_msg.created_at.replace(microsecond=0, tzinfo=datetime.timezone.utc) dauer = str(now_time - then_time) for m in bot.get_channel(435869507123281920).members: await m.move_to(bot.get_channel(801869864745697280))