aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/events/hacktoberfest/hacktoberstats.py
diff options
context:
space:
mode:
authorGravatar shtlrs <[email protected]>2023-05-06 14:06:53 +0100
committerGravatar shtlrs <[email protected]>2023-05-06 14:06:53 +0100
commitcd16be11b5686f4d8e63db303b884ed88efb18d1 (patch)
treef4fbc6bc4cd93ba2a89b1c4cc6c5c2012549421e /bot/exts/events/hacktoberfest/hacktoberstats.py
parentuse the new code jam variable (#1267) (diff)
Run null check on needed api keys before loading cogs.
This makes sure that all cogs that need keys won't load. Which helps in avoiding exceptions at runtime, and give a clearer warning at startup time.
Diffstat (limited to 'bot/exts/events/hacktoberfest/hacktoberstats.py')
-rw-r--r--bot/exts/events/hacktoberfest/hacktoberstats.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bot/exts/events/hacktoberfest/hacktoberstats.py b/bot/exts/events/hacktoberfest/hacktoberstats.py
index 0b4266d8..5bfac93f 100644
--- a/bot/exts/events/hacktoberfest/hacktoberstats.py
+++ b/bot/exts/events/hacktoberfest/hacktoberstats.py
@@ -434,4 +434,6 @@ class HacktoberStats(commands.Cog):
async def setup(bot: Bot) -> None:
"""Load the Hacktober Stats Cog."""
+ if not Tokens.github:
+ log.warning("No GitHub token was provided. The HacktoberStats Cog won't be fully functional.")
await bot.add_cog(HacktoberStats(bot))