From 3662734b9434e0aa10f11bbe37f3dece8b311984 Mon Sep 17 00:00:00 2001 From: Numerlor Date: Wed, 2 Oct 2019 00:14:05 +0200 Subject: Use rewritten override_in_channel to create a new whitelist for the command --- bot/seasons/halloween/hacktoberstats.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bot') diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py index 3e9bd508..035eafbc 100644 --- a/bot/seasons/halloween/hacktoberstats.py +++ b/bot/seasons/halloween/hacktoberstats.py @@ -10,8 +10,8 @@ import aiohttp import discord from discord.ext import commands -from bot.constants import Channels, STAFF_ROLES, WHITELISTED_CHANNELS -from bot.decorators import in_channel_check +from bot.constants import Channels, WHITELISTED_CHANNELS +from bot.decorators import override_in_channel from bot.utils.persist import make_persistent @@ -19,6 +19,7 @@ log = logging.getLogger(__name__) CURRENT_YEAR = datetime.now().year # Used to construct GH API query PRS_FOR_SHIRT = 4 # Minimum number of PRs before a shirt is awarded +HACKTOBER_WHITELIST = WHITELISTED_CHANNELS + (Channels.hacktoberfest_2019,) class HacktoberStats(commands.Cog): @@ -29,8 +30,8 @@ class HacktoberStats(commands.Cog): self.link_json = make_persistent(Path("bot", "resources", "halloween", "github_links.json")) self.linked_accounts = self.load_linked_users() - @commands.check(in_channel_check(*(*WHITELISTED_CHANNELS, Channels.hacktoberfest_2019), bypass_roles=STAFF_ROLES)) @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: """ Display an embed for a user's Hacktoberfest contributions. -- cgit v1.2.3