fix error in stop command coming from timezone addition

This commit is contained in:
Aaron Riedel 2022-01-29 18:47:28 +01:00
parent 4208fb5d15
commit dd4c7e7fe0

6
bot.py
View file

@ -254,13 +254,13 @@ async def start(ctx, role_id):
@bot.command(help="Beende die gestartete Runde PnP", usage="") @bot.command(help="Beende die gestartete Runde PnP", usage="")
@is_gm() @is_gm()
async def stop(ctx): async def stop(ctx):
#await ctx.message.delete() await ctx.message.delete()
text_file = open("start_id.txt", "r") text_file = open("start_id.txt", "r")
start_id = text_file.read() start_id = text_file.read()
text_file.close() text_file.close()
start_msg = await bot.get_channel(435501602485305345).fetch_message(start_id) start_msg = await bot.get_channel(435501602485305345).fetch_message(start_id)
now_time = datetime.datetime.utcnow().replace(microsecond=0) now_time = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc)
then_time = start_msg.created_at.replace(microsecond=0) then_time = start_msg.created_at.replace(microsecond=0, tzinfo=datetime.timezone.utc)
dauer = str(now_time - then_time) dauer = str(now_time - then_time)
for m in bot.get_channel(435869507123281920).members: for m in bot.get_channel(435869507123281920).members:
await m.move_to(bot.get_channel(801869864745697280)) await m.move_to(bot.get_channel(801869864745697280))