aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/moderation/silence.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bot/exts/moderation/silence.py b/bot/exts/moderation/silence.py
index 366d4e1f5..bf553f847 100644
--- a/bot/exts/moderation/silence.py
+++ b/bot/exts/moderation/silence.py
@@ -6,7 +6,7 @@ from datetime import datetime, timedelta, timezone
from typing import Optional, OrderedDict, Union
from async_rediscache import RedisCache
-from discord import Guild, PermissionOverwrite, TextChannel, VoiceChannel
+from discord import Guild, PermissionOverwrite, TextChannel, Thread, VoiceChannel
from discord.ext import commands, tasks
from discord.ext.commands import Context
from discord.utils import MISSING
@@ -182,6 +182,12 @@ class Silence(commands.Cog):
channel_info = f"#{channel} ({channel.id})"
log.debug(f"{ctx.author} is silencing channel {channel_info}.")
+ # Since threads don't have specific overrides, we cannot silence them individually.
+ # The parent channel has to be muted or the thread should be archived.
+ if isinstance(channel, Thread):
+ await ctx.send(":x: Threads cannot be silenced.")
+ return
+
if not await self._set_silence_overwrites(channel, kick=kick):
log.info(f"Tried to silence channel {channel_info} but the channel was already silenced.")
await self.send_message(MSG_SILENCE_FAIL, ctx.channel, channel, alert_target=False)