diff options
author | 2020-08-15 20:21:13 -0700 | |
---|---|---|
committer | 2020-08-15 20:21:19 -0700 | |
commit | c5617ec5d9ed9f0a76b2b8eb89ed28001a0542f9 (patch) | |
tree | 466cba185c2997dba288c052827f918a6164ba6f | |
parent | Silence: notify admins if previous overwrites were not cached (diff) |
Silence: add separate unsilence error for manually-silenced channels
It was confusing to reject a silence and an unsilence when overwrites
were manually set to False. That's because it's contradictory to show
an error stating it's already silence but then reject an unsilence with
an error stating the channel isn't silenced.
-rw-r--r-- | bot/cogs/moderation/silence.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bot/cogs/moderation/silence.py b/bot/cogs/moderation/silence.py index ea2f51574..9863730f4 100644 --- a/bot/cogs/moderation/silence.py +++ b/bot/cogs/moderation/silence.py @@ -110,8 +110,16 @@ class Silence(commands.Cog): """ await self._get_instance_vars_event.wait() log.debug(f"Unsilencing channel #{ctx.channel} from {ctx.author}'s command.") + if not await self._unsilence(ctx.channel): - await ctx.send(f"{Emojis.cross_mark} current channel was not silenced.") + overwrite = ctx.channel.overwrites_for(self._verified_role) + if overwrite.send_messages is False and overwrite.add_reactions is False: + await ctx.send( + f"{Emojis.cross_mark} current channel was not unsilenced because the current " + f"overwrites were set manually. Please edit them manually to unsilence." + ) + else: + await ctx.send(f"{Emojis.cross_mark} current channel was not silenced.") else: await ctx.send(f"{Emojis.check_mark} unsilenced current channel.") |