aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2021-01-21 02:51:34 +0200
committerGravatar mbaruh <[email protected]>2021-01-21 02:51:34 +0200
commit1478da27d899d23de72c9236a359a92a57708f1c (patch)
tree3d1fd61b119d1ff997de8301e42660cf084e9d2d
parentSlowmode reset now uses slowmode set (diff)
Added slowmode stat for python-general.
-rw-r--r--bot/constants.py2
-rw-r--r--bot/exts/moderation/slowmode.py6
-rw-r--r--config-default.yml4
3 files changed, 8 insertions, 4 deletions
diff --git a/bot/constants.py b/bot/constants.py
index be8d303f6..f2cc64702 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -429,7 +429,7 @@ class Channels(metaclass=YAMLGetter):
off_topic_1: int
off_topic_2: int
organisation: int
- python_discussion: int
+ python_general: int
python_events: int
python_news: int
reddit: int
diff --git a/bot/exts/moderation/slowmode.py b/bot/exts/moderation/slowmode.py
index 80eec34a0..b72985d73 100644
--- a/bot/exts/moderation/slowmode.py
+++ b/bot/exts/moderation/slowmode.py
@@ -7,7 +7,7 @@ from discord import TextChannel
from discord.ext.commands import Cog, Context, group, has_any_role
from bot.bot import Bot
-from bot.constants import Emojis, MODERATION_ROLES
+from bot.constants import Channels, Emojis, MODERATION_ROLES
from bot.converters import DurationDelta
from bot.utils import time
@@ -58,6 +58,10 @@ 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:
+ log.info(f'Recording slowmode change in stats for {channel.name}.')
+ self.bot.stats.gauge(f"slowmode.{channel.name}", 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 f8368c5d2..530feffe5 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -157,7 +157,7 @@ guild:
# Discussion
meta: 429409067623251969
- python_discussion: &PY_DISCUSSION 267624335836053506
+ python_general: &PY_GENERAL 267624335836053506
# Python Help: Available
cooldown: 720603994149486673
@@ -430,7 +430,7 @@ code_block:
# The channels which will be affected by a cooldown. These channels are also whitelisted.
cooldown_channels:
- - *PY_DISCUSSION
+ - *PY_GENERAL
# Sending instructions triggers a cooldown on a per-channel basis.
# More instruction messages will not be sent in the same channel until the cooldown has elapsed.