diff options
author | 2023-05-06 14:06:53 +0100 | |
---|---|---|
committer | 2023-05-06 14:06:53 +0100 | |
commit | cd16be11b5686f4d8e63db303b884ed88efb18d1 (patch) | |
tree | f4fbc6bc4cd93ba2a89b1c4cc6c5c2012549421e /bot/exts/utilities/wolfram.py | |
parent | use 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/utilities/wolfram.py')
-rw-r--r-- | bot/exts/utilities/wolfram.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/exts/utilities/wolfram.py b/bot/exts/utilities/wolfram.py index a036b50f..9d28608c 100644 --- a/bot/exts/utilities/wolfram.py +++ b/bot/exts/utilities/wolfram.py @@ -303,4 +303,7 @@ class Wolfram(Cog): async def setup(bot: Bot) -> None: """Load the Wolfram cog.""" + if not Wolfram.key: + log.warning("No Wolfram API Key was provided. Not loading Wolfram Cog.") + return await bot.add_cog(Wolfram(bot)) |