aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/christmas/adventofcode.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bot/exts/christmas/adventofcode.py (renamed from bot/seasons/christmas/adventofcode.py)11
1 files changed, 6 insertions, 5 deletions
diff --git a/bot/seasons/christmas/adventofcode.py b/bot/exts/christmas/adventofcode.py
index 8caf43bd..cc3923c8 100644
--- a/bot/seasons/christmas/adventofcode.py
+++ b/bot/exts/christmas/adventofcode.py
@@ -13,9 +13,9 @@ from bs4 import BeautifulSoup
from discord.ext import commands
from pytz import timezone
-from bot.constants import AdventOfCode as AocConfig, Channels, Colours, Emojis, Tokens, WHITELISTED_CHANNELS
-from bot.decorators import override_in_channel
+from bot.constants import AdventOfCode as AocConfig, Channels, Colours, Emojis, Month, Tokens, WHITELISTED_CHANNELS
from bot.utils import unlocked_role
+from bot.utils.decorators import in_month, override_in_channel
log = logging.getLogger(__name__)
@@ -153,11 +153,13 @@ class AdventOfCode(commands.Cog):
status_coro = countdown_status(self.bot)
self.status_task = self.bot.loop.create_task(status_coro)
- @commands.group(name="adventofcode", aliases=("aoc",), invoke_without_command=True)
+ @in_month(Month.DECEMBER)
+ @commands.group(name="adventofcode", aliases=("aoc",))
@override_in_channel(AOC_WHITELIST)
async def adventofcode_group(self, ctx: commands.Context) -> None:
"""All of the Advent of Code commands."""
- await ctx.send_help(ctx.command)
+ if not ctx.invoked_subcommand:
+ await ctx.send_help(ctx.command)
@adventofcode_group.command(
name="subscribe",
@@ -739,4 +741,3 @@ def _error_embed_helper(title: str, description: str) -> discord.Embed:
def setup(bot: commands.Bot) -> None:
"""Advent of Code Cog load."""
bot.add_cog(AdventOfCode(bot))
- log.info("AdventOfCode cog loaded")