diff --git a/bot/exts/advent_of_code/_cog.py b/bot/exts/advent_of_code/_cog.py index 8b292f1..a9e8524 100644 --- a/bot/exts/advent_of_code/_cog.py +++ b/bot/exts/advent_of_code/_cog.py @@ -182,6 +182,25 @@ async def aoc_countdown(self, ctx: commands.Context) -> None: f"The next event will start ." ) + @aoc_slash_group.command(name="countdown", description="Return time left until next day") + @whitelist_override(channels=AOC_WHITELIST) + async def aoc_countdown_slash(self, interaction: discord.Interaction) -> None: + """Return time left until next day.""" + if _helpers.is_in_advent(): + tomorrow, _ = _helpers.time_left_to_est_midnight() + next_day_timestamp = int(tomorrow.timestamp()) + + await interaction.response.send_message(f"Day {tomorrow.day} starts .") + return + + next_aoc, _ = _helpers.time_left_to_next_aoc() + next_aoc_timestamp = int(next_aoc.timestamp()) + + await interaction.response.send_message( + "The Advent of Code event is not currently running. " + f"The next event will start ." + ) + @adventofcode_group.command(name="about", aliases=("ab", "info"), brief="Learn about Advent of Code") @whitelist_override(channels=AOC_WHITELIST) async def about_aoc(self, ctx: commands.Context) -> None: