aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-11-29 15:10:29 +0000
committerGravatar Chris Lovering <[email protected]>2021-11-29 15:10:29 +0000
commitc81d30357db2c0950d5e781cdd5e9053907b228d (patch)
treeafd41bd2d4ee589266695a38f5e3600c081409dc
parentUse a Discord timestamp to show countdown (diff)
Use Discord timestamps for aoc next day messages countdowns
-rw-r--r--bot/exts/events/advent_of_code/_cog.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/exts/events/advent_of_code/_cog.py b/bot/exts/events/advent_of_code/_cog.py
index 94722005..af1cbcf5 100644
--- a/bot/exts/events/advent_of_code/_cog.py
+++ b/bot/exts/events/advent_of_code/_cog.py
@@ -101,14 +101,13 @@ class AdventOfCode(commands.Cog):
async def aoc_countdown(self, ctx: commands.Context) -> None:
"""Return time left until next day."""
if _helpers.is_in_advent():
- tomorrow, time_left = _helpers.time_left_to_est_midnight()
- hours, minutes = time_left.seconds // 3600, time_left.seconds // 60 % 60
+ tomorrow, _ = _helpers.time_left_to_est_midnight()
+ next_day_timestamp = int(tomorrow.timestamp())
- await ctx.send(f"There are {hours} hours and {minutes} minutes left until day {tomorrow.day}.")
+ await ctx.send(f"Day {tomorrow.day} starts <t:{next_day_timestamp}:R>.")
return
datetime_now = arrow.now(_helpers.EST)
-
# Calculate the delta to this & next year's December 1st to see which one is closest and not in the past
this_year = arrow.get(datetime(datetime_now.year, 12, 1), _helpers.EST)
next_year = arrow.get(datetime(datetime_now.year + 1, 12, 1), _helpers.EST)