Skip to content

Commit 4dc6fa7

Browse files
committed
fix time zone issue
1 parent d57fa77 commit 4dc6fa7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

discord_bot/cogs/commands.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from util.gifs import perform_gif_overlay
99
from random import shuffle
1010
from datetime import date, timedelta
11+
from zoneinfo import ZoneInfo
1112

1213

1314
class Commands(commands.Cog):
@@ -29,8 +30,9 @@ def get_judge(self) -> list[str, str]:
2930
"161921661346643968",
3031
"196069761082327041",
3132
]
33+
tz = ZoneInfo("America/New_York")
3234
start_monday: date = date(2025, 6, 9)
33-
nearest_monday = date.today() + timedelta((7 - date.today().weekday()) % 7)
35+
nearest_monday = date.today(tz) + timedelta((7 - date.today().weekday()) % 7)
3436
day_delta = nearest_monday - start_monday
3537
week_delta = day_delta.days // 7
3638
return [NAMES[week_delta % len(NAMES)], IDS[week_delta % len(IDS)]]
@@ -119,11 +121,11 @@ async def whojudge_debug(self, interaction: discord.Interaction):
119121
@app_commands.command(name="screen", description="ragebait")
120122
@app_commands.describe(gif="GIF URL")
121123
async def screen(self, interaction: discord.Interaction, gif: str):
122-
await interaction.response.send_message(
123-
content="Generating..."
124-
)
124+
await interaction.response.send_message(content="Generating...")
125125
res = perform_gif_overlay(gif)
126-
return await interaction.channel.send(file=discord.File(io.BytesIO(res), filename="output.gif"))
126+
return await interaction.channel.send(
127+
file=discord.File(io.BytesIO(res), filename="output.gif")
128+
)
127129

128130

129131
async def setup(bot):

0 commit comments

Comments
 (0)