diff options
| author | 2020-10-16 11:44:23 -0700 | |
|---|---|---|
| committer | 2020-11-20 15:53:34 -0800 | |
| commit | a1b2e8e9bff23ad5c9c8db8fa35116e7ce6a4965 (patch) | |
| tree | c116b9a0c59c44fa022caf72d1b141dd14ab87a3 | |
| parent | Help channels: move to a subpackage (diff) | |
Help channels: remove get_clean_channel_name
Emoji are no longer used in channel names due to harsher rate limits
for renaming channels. Therefore, the function is obsolete.
| -rw-r--r-- | bot/exts/help_channels/_cog.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/bot/exts/help_channels/_cog.py b/bot/exts/help_channels/_cog.py index 5e2a7dd71..00dd36304 100644 --- a/bot/exts/help_channels/_cog.py +++ b/bot/exts/help_channels/_cog.py @@ -252,21 +252,6 @@ class HelpChannels(commands.Cog): return channel @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 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 because `{channel}` isn't prefixed by `{prefix}`.") - name = channel.name - - return name - - @staticmethod def is_excluded_channel(channel: discord.abc.GuildChannel) -> bool: """Check if a channel should be excluded from the help channel system.""" return not isinstance(channel, discord.TextChannel) or channel.id in EXCLUDED_CHANNELS @@ -317,7 +302,7 @@ class HelpChannels(commands.Cog): names = set() for cat in (self.available_category, self.in_use_category, self.dormant_category): for channel in self.get_category_channels(cat): - names.add(self.get_clean_channel_name(channel)) + names.add(channel.name) if len(names) > MAX_CHANNELS_PER_CATEGORY: log.warning( |