diff options
author | 2022-10-17 14:52:05 +0100 | |
---|---|---|
committer | 2022-10-17 14:52:05 +0100 | |
commit | d53b855c504ecc06fd0c454d6b17f2653623320d (patch) | |
tree | 748e80d983c1f61dbb14e70c6d8e5a1affc5b80b | |
parent | Merge pull request #2287 from python-discord/bump-bot-core (diff) |
Support the new SequenceProxy type in d.py
This type is usd for a few attributes, including Guild.threads and guild.Channels. This type does not implement any of the add dunder methods, so we use itertools.chain to get a single iterator for both sequences.
Fixes BOT-398 Fixees #2292
-rw-r--r-- | bot/exts/moderation/clean.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/moderation/clean.py b/bot/exts/moderation/clean.py index 748c018d2..fd9404b1a 100644 --- a/bot/exts/moderation/clean.py +++ b/bot/exts/moderation/clean.py @@ -1,4 +1,5 @@ import contextlib +import itertools import re import time from collections import defaultdict @@ -130,7 +131,7 @@ class Clean(Cog): else: if channels == "*": channels = { - channel for channel in ctx.guild.channels + ctx.guild.threads + channel for channel in itertools.chain(ctx.guild.channels, ctx.guild.threads) if isinstance(channel, (TextChannel, Thread)) # Assume that non-public channels are not needed to optimize for speed. and channel.permissions_for(ctx.guild.default_role).view_channel |