Skip to content

Commit da82db9

Browse files
committed
Ignore channels that can't be written in
1 parent 8c35889 commit da82db9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

bot/exts/moderation/clean.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ def _channels_set(
136136
channels = {
137137
channel for channel in itertools.chain(ctx.guild.channels, ctx.guild.threads)
138138
if isinstance(channel, TextChannel | Thread)
139-
# Assume that non-public channels are not needed to optimize for speed.
139+
# Ignore non-public channels or ones that can't be written in to optimize for speed.
140140
and channel.permissions_for(ctx.guild.default_role).view_channel
141+
and channel.permissions_for(ctx.guild.default_role).send_messages
141142
}
142143
else:
143144
channels = set(channels)

0 commit comments

Comments
 (0)