From d53b855c504ecc06fd0c454d6b17f2653623320d Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 17 Oct 2022 14:52:05 +0100 Subject: 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 --- bot/exts/moderation/clean.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3