aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/constants.py1
-rw-r--r--bot/exts/moderation/slowmode.py10
-rw-r--r--config-default.yml3
3 files changed, 12 insertions, 2 deletions
diff --git a/bot/constants.py b/bot/constants.py
index f2cc64702..2f5cf0e8a 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -408,6 +408,7 @@ class Channels(metaclass=YAMLGetter):
code_help_voice_2: int
cooldown: int
defcon: int
+ discord_py: int
dev_contrib: int
dev_core: int
dev_log: int
diff --git a/bot/exts/moderation/slowmode.py b/bot/exts/moderation/slowmode.py
index b72985d73..c449752e1 100644
--- a/bot/exts/moderation/slowmode.py
+++ b/bot/exts/moderation/slowmode.py
@@ -15,6 +15,12 @@ log = logging.getLogger(__name__)
SLOWMODE_MAX_DELAY = 21600 # seconds
+COMMONLY_SLOWMODED_CHANNELS = {
+ Channels.python_general: "python_general",
+ Channels.discord_py: "discordpy",
+ Channels.off_topic_0: "ot0",
+}
+
class Slowmode(Cog):
"""Commands for getting and setting slowmode delays of text channels."""
@@ -58,9 +64,9 @@ class Slowmode(Cog):
log.info(f'{ctx.author} set the slowmode delay for #{channel} to {humanized_delay}.')
await channel.edit(slowmode_delay=slowmode_delay)
- if channel.id == Channels.python_general:
+ if channel.id in COMMONLY_SLOWMODED_CHANNELS:
log.info(f'Recording slowmode change in stats for {channel.name}.')
- self.bot.stats.gauge(f"slowmode.{channel.name}", slowmode_delay)
+ self.bot.stats.gauge(f"slowmode.{COMMONLY_SLOWMODED_CHANNELS[channel.id]}", slowmode_delay)
await ctx.send(
f'{Emojis.check_mark} The slowmode delay for {channel.mention} is now {humanized_delay}.'
diff --git a/config-default.yml b/config-default.yml
index 530feffe5..6695cffed 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -162,6 +162,9 @@ guild:
# Python Help: Available
cooldown: 720603994149486673
+ # Topical
+ discord_py: 343944376055103488
+
# Logs
attachment_log: &ATTACH_LOG 649243850006855680
message_log: &MESSAGE_LOG 467752170159079424