diff options
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/halloween/hacktoberstats.py (renamed from bot/seasons/halloween/hacktoberstats.py) | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/exts/halloween/hacktoberstats.py index d61e048b..e01ee50c 100644 --- a/bot/seasons/halloween/hacktoberstats.py +++ b/bot/exts/halloween/hacktoberstats.py @@ -10,11 +10,10 @@ import aiohttp import discord from discord.ext import commands -from bot.constants import Channels, WHITELISTED_CHANNELS -from bot.decorators import override_in_channel +from bot.constants import Channels, Month, WHITELISTED_CHANNELS +from bot.utils.decorators import in_month, override_in_channel from bot.utils.persist import make_persistent - log = logging.getLogger(__name__) CURRENT_YEAR = datetime.now().year # Used to construct GH API query @@ -30,6 +29,7 @@ class HacktoberStats(commands.Cog): self.link_json = make_persistent(Path("bot", "resources", "halloween", "github_links.json")) self.linked_accounts = self.load_linked_users() + @in_month(Month.OCTOBER) @commands.group(name="hacktoberstats", aliases=("hackstats",), invoke_without_command=True) @override_in_channel(HACKTOBER_WHITELIST) async def hacktoberstats_group(self, ctx: commands.Context, github_username: str = None) -> None: @@ -57,6 +57,7 @@ class HacktoberStats(commands.Cog): await self.get_stats(ctx, github_username) + @in_month(Month.OCTOBER) @hacktoberstats_group.command(name="link") @override_in_channel(HACKTOBER_WHITELIST) async def link_user(self, ctx: commands.Context, github_username: str = None) -> None: @@ -91,6 +92,7 @@ class HacktoberStats(commands.Cog): logging.info(f"{author_id} tried to link a GitHub account but didn't provide a username") await ctx.send(f"{author_mention}, a GitHub username is required to link your account") + @in_month(Month.OCTOBER) @hacktoberstats_group.command(name="unlink") @override_in_channel(HACKTOBER_WHITELIST) async def unlink_user(self, ctx: commands.Context) -> None: @@ -337,4 +339,3 @@ class HacktoberStats(commands.Cog): def setup(bot: commands.Bot) -> None: """Hacktoberstats Cog load.""" bot.add_cog(HacktoberStats(bot)) - log.info("HacktoberStats cog loaded") |