Skip to content

Commit

Permalink
[Defender] WD: Ensure issuer of issue-command can view the channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Twentysix26 committed Jan 31, 2022
1 parent 6c604ce commit 72dd932
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions defender/core/warden/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,9 @@ async def issue_command(params: models.IssueCommand):
if msg_obj.channel is None:
raise ExecutionError(f"Failed to issue command. I could not find the "
"notification channel.")
if msg_obj.channel.permissions_for(issuer).view_channel is False:
raise ExecutionError("Failed to issue command. The issuer has no permissions "
"to view the destination channel.")

msg_obj.author = issuer
prefix = await cog.bot.get_prefix(msg_obj)
Expand Down

0 comments on commit 72dd932

Please sign in to comment.