Skip to content

Commit

Permalink
Prevent one from using the !echo command for a channel in which one…
Browse files Browse the repository at this point in the history
… can't speak.
  • Loading branch information
swfarnsworth committed Jun 22, 2021
1 parent 7fc9b77 commit 57bc7ba
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bot/exts/utils/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ async def echo_command(self, ctx: Context, channel: Optional[TextChannel], *, te
"""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)

Expand Down

0 comments on commit 57bc7ba

Please sign in to comment.