diff options
| author | 2023-05-06 17:19:28 +0100 | |
|---|---|---|
| committer | 2023-05-06 17:19:28 +0100 | |
| commit | 56cefe8f3e1ec4ca6c0cb26a64c2a13d146d6448 (patch) | |
| tree | b6a35a1504df0f0a9bd9f5bfc2edfde0d8948f05 /bot/exts/fun | |
| parent | use the new code jam variable (#1267) (diff) | |
| parent | Update bot/exts/holidays/halloween/spookygif.py (diff) | |
Merge pull request #1269 from shtlrs/load-cogs-when-config-is-setup
Run null check on needed API keys before loading cogs.
Diffstat (limited to 'bot/exts/fun')
| -rw-r--r-- | bot/exts/fun/movie.py | 3 | ||||
| -rw-r--r-- | bot/exts/fun/snakes/__init__.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/bot/exts/fun/movie.py b/bot/exts/fun/movie.py index 73ef0a3c..21183e0f 100644 --- a/bot/exts/fun/movie.py +++ b/bot/exts/fun/movie.py @@ -208,4 +208,7 @@ class Movie(Cog): async def setup(bot: Bot) -> None: """Load the Movie Cog.""" + if not Tokens.tmdb: + logger.warning("No TMDB token. Not loading Movie Cog.") + return await bot.add_cog(Movie(bot)) diff --git a/bot/exts/fun/snakes/__init__.py b/bot/exts/fun/snakes/__init__.py index 8aa39fb5..be71ac44 100644 --- a/bot/exts/fun/snakes/__init__.py +++ b/bot/exts/fun/snakes/__init__.py @@ -1,6 +1,7 @@ import logging from bot.bot import Bot +from bot.constants import Tokens from bot.exts.fun.snakes._snakes_cog import Snakes log = logging.getLogger(__name__) @@ -8,4 +9,6 @@ log = logging.getLogger(__name__) async def setup(bot: Bot) -> None: """Load the Snakes Cog.""" + if not Tokens.youtube: + log.warning("No Youtube token. All YouTube related commands in Snakes cog won't work.") await bot.add_cog(Snakes(bot)) |