aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-05-28 22:31:37 +0100
committerGravatar Chris Lovering <[email protected]>2022-05-28 22:31:37 +0100
commitc825718dbb8a597e6c9620601ed1b9b2ca5dcb98 (patch)
tree68bbe64a8114b118887c1c9710b551d1bae6878c
parentFix !clean users command to handle more than one user (#2178) (diff)
Clean from public active threads when channels is set to *
-rw-r--r--bot/exts/moderation/clean.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/moderation/clean.py b/bot/exts/moderation/clean.py
index 67f1851c4..1c47f8342 100644
--- a/bot/exts/moderation/clean.py
+++ b/bot/exts/moderation/clean.py
@@ -7,7 +7,7 @@ from datetime import datetime
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 @@ class Clean(Cog):
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
}