diff options
-rw-r--r-- | bot/__main__.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bot/__main__.py b/bot/__main__.py index ebd91f836..5c1184c10 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -1,11 +1,15 @@ +import logging import os from aiohttp import AsyncResolver, ClientSession, TCPConnector from discord import Game from discord.ext.commands import AutoShardedBot, when_mentioned_or +from bot.constants import CLICKUP_KEY from bot.formatter import Formatter +log = logging.getLogger(__name__) + bot = AutoShardedBot( command_prefix=when_mentioned_or( "self.", "bot." @@ -33,7 +37,14 @@ bot.load_extension("bot.cogs.events") # Commands, etc bot.load_extension("bot.cogs.bot") bot.load_extension("bot.cogs.cogs") -bot.load_extension("bot.cogs.clickup") + +# Local setups usually don't have the clickup key set, +# and loading the cog would simply spam errors in the console. +if CLICKUP_KEY is not None: + bot.load_extension("bot.cogs.clickup") +else: + log.warning("`CLICKUP_KEY` not set in the environment, not loading the ClickUp cog.") + bot.load_extension("bot.cogs.deployment") bot.load_extension("bot.cogs.eval") bot.load_extension("bot.cogs.fun") |