aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2019-10-01 21:38:04 +0200
committerGravatar Numerlor <[email protected]>2019-10-01 21:38:04 +0200
commit2aed38d7b6383db9cd07be8e5595dc1cb86e029b (patch)
treea0ba620fde278300b75fb4fe732fd70563b3556b
parentremove hacktoberfest channel from global whitelist (diff)
allow hacktoberstats commands to be used in the hacktober channel
-rw-r--r--bot/seasons/halloween/hacktoberstats.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bot/seasons/halloween/hacktoberstats.py b/bot/seasons/halloween/hacktoberstats.py
index 7fbd9b62..625e7324 100644
--- a/bot/seasons/halloween/hacktoberstats.py
+++ b/bot/seasons/halloween/hacktoberstats.py
@@ -10,8 +10,11 @@ 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.utils.persist import make_persistent
+
log = logging.getLogger(__name__)
CURRENT_YEAR = datetime.now().year # Used to construct GH API query
@@ -26,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()
+ @commands.check(in_channel_check(*(*WHITELISTED_CHANNELS, Channels.hacktoberfest_2019), bypass_roles=STAFF_ROLES))
@commands.group(name="hacktoberstats", aliases=("hackstats",), invoke_without_command=True)
async def hacktoberstats_group(self, ctx: commands.Context, github_username: str = None) -> None:
"""