From 57bc7ba839bfaf2cebd48ad7199c5021d76e5920 Mon Sep 17 00:00:00 2001 From: swfarnsworth Date: Tue, 22 Jun 2021 17:41:28 -0400 Subject: Prevent one from using the `!echo` command for a channel in which one can't speak. --- bot/exts/utils/bot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bot/exts/utils/bot.py b/bot/exts/utils/bot.py index a4c828f95..f372a54e4 100644 --- a/bot/exts/utils/bot.py +++ b/bot/exts/utils/bot.py @@ -44,6 +44,8 @@ class BotCog(Cog, name="Bot"): """Repeat the given message in either a specified channel or the current channel.""" if channel is None: await ctx.send(text) + elif not channel.permissions_for(ctx.author).send_messages: + await ctx.send('You don\'t have permission to speak in that channel.') else: await channel.send(text) -- cgit v1.2.3