From c825718dbb8a597e6c9620601ed1b9b2ca5dcb98 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 28 May 2022 22:31:37 +0100 Subject: [PATCH] Clean from public active threads when channels is set to * --- bot/exts/moderation/clean.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/moderation/clean.py b/bot/exts/moderation/clean.py index 67f1851c4c..1c47f8342b 100644 --- a/bot/exts/moderation/clean.py +++ b/bot/exts/moderation/clean.py @@ -7,7 +7,7 @@ from itertools import takewhile from typing import Callable, Iterable, Literal, Optional, TYPE_CHECKING, Union -from discord import Colour, Message, NotFound, TextChannel, User, errors +from discord import Colour, Message, NotFound, TextChannel, Thread, User, errors from discord.ext.commands import Cog, Context, Converter, Greedy, group, has_any_role from discord.ext.commands.converter import TextChannelConverter from discord.ext.commands.errors import BadArgument @@ -130,8 +130,8 @@ def _channels_set( else: if channels == "*": channels = { - channel for channel in ctx.guild.channels - if isinstance(channel, TextChannel) + channel for channel in 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 }