aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar swfarnsworth <[email protected]>2021-06-22 17:41:28 -0400
committerGravatar swfarnsworth <[email protected]>2021-06-22 17:41:28 -0400
commit57bc7ba839bfaf2cebd48ad7199c5021d76e5920 (patch)
tree9319c8c80715055b33ad2abed0b0462d9b3b2278
parentMerge pull request #1648 from python-discord/voice-verify-pings (diff)
Prevent one from using the `!echo` command for a channel in which one can't speak.
-rw-r--r--bot/exts/utils/bot.py2
1 files changed, 2 insertions, 0 deletions
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)