diff options
| -rw-r--r-- | bot/__main__.py | 13 | ||||
| -rw-r--r-- | bot/constants.py | 1 | ||||
| -rw-r--r-- | config-default.yml | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/bot/__main__.py b/bot/__main__.py index 30a7dee41..f6ca5a9c8 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -5,9 +5,8 @@ import sentry_sdk from discord.ext.commands import when_mentioned_or from sentry_sdk.integrations.logging import LoggingIntegration -from bot import patches +from bot import constants, patches from bot.bot import Bot -from bot.constants import Bot as BotConfig sentry_logging = LoggingIntegration( level=logging.DEBUG, @@ -15,12 +14,12 @@ sentry_logging = LoggingIntegration( ) sentry_sdk.init( - dsn=BotConfig.sentry_dsn, + dsn=constants.Bot.sentry_dsn, integrations=[sentry_logging] ) bot = Bot( - command_prefix=when_mentioned_or(BotConfig.prefix), + command_prefix=when_mentioned_or(constants.Bot.prefix), activity=discord.Game(name="Commands: !help"), case_insensitive=True, max_messages=10_000, @@ -49,7 +48,6 @@ bot.load_extension("bot.cogs.alias") bot.load_extension("bot.cogs.defcon") bot.load_extension("bot.cogs.eval") bot.load_extension("bot.cogs.duck_pond") -bot.load_extension("bot.cogs.help_channels") bot.load_extension("bot.cogs.information") bot.load_extension("bot.cogs.jams") bot.load_extension("bot.cogs.moderation") @@ -65,8 +63,11 @@ bot.load_extension("bot.cogs.utils") bot.load_extension("bot.cogs.watchchannels") bot.load_extension("bot.cogs.wolfram") +if constants.HelpChannels.enable: + bot.load_extension("bot.cogs.help_channels") + # Apply `message_edited_at` patch if discord.py did not yet release a bug fix. if not hasattr(discord.message.Message, '_handle_edited_timestamp'): patches.message_edited_at.apply_patch() -bot.run(BotConfig.token) +bot.run(constants.Bot.token) diff --git a/bot/constants.py b/bot/constants.py index 8e9d40e8d..da1a62780 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -529,6 +529,7 @@ class Free(metaclass=YAMLGetter): class HelpChannels(metaclass=YAMLGetter): section = 'help_channels' + enable: bool claim_minutes: int cmd_whitelist: List[int] idle_minutes: int diff --git a/config-default.yml b/config-default.yml index d87ceade7..12f69deca 100644 --- a/config-default.yml +++ b/config-default.yml @@ -505,6 +505,8 @@ mention: reset_delay: 5 help_channels: + enable: false + # Minimum interval before allowing a certain user to claim a new help channel claim_minutes: 15 |