diff options
| author | 2020-02-24 13:08:19 -0800 | |
|---|---|---|
| committer | 2020-03-22 15:54:34 -0700 | |
| commit | b64524d56a407a21f85b08b7ae7147fa13283543 (patch) | |
| tree | 0513be6fb4358cca40ddd6df2005aef5e2af48a0 | |
| parent | HelpChannels: retrieve category channels more efficiently (diff) | |
HelpChannels: only yield text channels from a category
| -rw-r--r-- | bot/cogs/help_channels.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py index 1ba435308..f7af5d3be 100644 --- a/bot/cogs/help_channels.py +++ b/bot/cogs/help_channels.py @@ -86,10 +86,10 @@ class HelpChannels(Scheduler, commands.Cog): @staticmethod def get_category_channels(category: discord.CategoryChannel) -> t.Iterable[discord.TextChannel]: - """Yield the channels of the `category` in an unsorted manner.""" + """Yield the text channels of the `category` in an unsorted manner.""" # This is faster than using category.channels because the latter sorts them. for channel in category.guild.channels: - if channel.category_id == category.id: + if channel.category_id == category.id and isinstance(channel, discord.TextChannel): yield channel def get_used_names(self) -> t.Set[str]: |