aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-02-28 08:05:23 -0800
committerGravatar MarkKoz <[email protected]>2020-03-22 15:54:40 -0700
commit77392c9522eb2f69657d41537ba4e2109c35c315 (patch)
tree4bedf043ab9f088753f2d318c136148f44900d07
parentConstants: rename HelpChannels.notify_helpers to notify (diff)
Constants: add a channel constant for help channel notifications
-rw-r--r--bot/cogs/help_channels.py12
-rw-r--r--bot/constants.py1
-rw-r--r--config-default.yml4
3 files changed, 11 insertions, 6 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py
index dde52e1e7..d50a21f0b 100644
--- a/bot/cogs/help_channels.py
+++ b/bot/cogs/help_channels.py
@@ -441,11 +441,11 @@ class HelpChannels(Scheduler, commands.Cog):
async def notify_helpers(self) -> None:
"""
- Notify helpers in the #helpers channel about a lack of available help channels.
+ Notify helpers about a lack of available help channels.
- The notification can be disabled with `constants.HelpChannels.notify_helpers`. The
- minimum interval between notifications can be configured with
- `constants.HelpChannels.notify_minutes`.
+ The notification can be disabled with `constants.HelpChannels.notify`. The minimum interval
+ between notifications can be configured with `constants.HelpChannels.notify_minutes`. The
+ channel for notifications can be configured with `constants.HelpChannels.notify_channel`.
"""
if not constants.HelpChannels.notify:
return
@@ -458,8 +458,8 @@ class HelpChannels(Scheduler, commands.Cog):
should_send = True
if should_send:
- helpers_channel = self.bot.get_channel(constants.Channels.helpers)
- await helpers_channel.send(
+ channel = self.bot.get_channel(constants.HelpChannels.notify_channel)
+ await channel.send(
f"<@&{constants.Roles.helpers}> a new available help channel is needed but there "
f"are no more dormant ones. Consider freeing up some in-use channels manually by "
f"using the `!dormant` command within the channels."
diff --git a/bot/constants.py b/bot/constants.py
index 32968cfaa..7a0760eef 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -543,6 +543,7 @@ class HelpChannels(metaclass=YAMLGetter):
max_total_channels: int
name_prefix: str
notify: bool
+ notify_channel: int
notify_minutes: int
diff --git a/config-default.yml b/config-default.yml
index 27dfbdc64..b23271899 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -532,9 +532,13 @@ help_channels:
# Prefix for help channel names
name_prefix: 'help-'
+
# Notify if more available channels are needed but there are no more dormant ones
notify: true
+ # Channel in which to send notifications
+ notify_channel: *HELPERS
+
# Minimum interval between helper notifications
notify_minutes: 15