aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-04-06 18:06:39 +0200
committerGravatar Sebastiaan Zeeff <[email protected]>2020-04-06 18:06:39 +0200
commitdfbecd2077c72d7475aaece4a3f92a12b56a207c (patch)
treee9e0f6fb044a24aeed05d39b61e2bc57430a798a
parentChange bottom sorting strategy to using a large int (diff)
Use configurable prefix to clean help channel names
The help channel prefix is configurable as a constant, but I accidentally used a static prefix in the utility function that cleaned the channel names. This commit makes sure the utility method uses the prefix defined in the constants.
-rw-r--r--bot/cogs/help_channels.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py
index 60580695c..2e203df46 100644
--- a/bot/cogs/help_channels.py
+++ b/bot/cogs/help_channels.py
@@ -223,13 +223,14 @@ class HelpChannels(Scheduler, commands.Cog):
@staticmethod
def get_clean_channel_name(channel: discord.TextChannel) -> str:
"""Return a clean channel name without status emojis prefix."""
+ prefix = constants.HelpChannels.name_prefix
try:
- # Try to remove the status prefix using the index of "help-"
- name = channel.name[channel.name.index("help-"):]
+ # Try to remove the status prefix using the index of the channel prefix
+ name = channel.name[channel.name.index(prefix):]
log.trace(f"The clean name for `{channel}` is `{name}`")
except ValueError:
# If, for some reason, the channel name does not contain "help-" fall back gracefully
- log.info(f"Can't get clean name as `{channel}` does not follow the `help-` naming convention.")
+ log.info(f"Can't get clean name as `{channel}` does not follow the `{prefix}` naming convention.")
name = channel.name
return name