mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 07:17:56 +00:00
fix(bot): correct permission check on delete message command
This commit is contained in:
parent
eff4120ce1
commit
caf2b75f68
3 changed files with 5 additions and 3 deletions
|
|
@ -400,7 +400,8 @@ public class ProxiedMessage
|
|||
if (!showContent)
|
||||
throw new PKError(noShowContentError);
|
||||
|
||||
if (message.Message.Sender != ctx.Author.Id && (ctx.System != null && message.System?.Id != ctx.System.Id))
|
||||
// if user has has a system and their system sent the message, or if user sent the message, do not error
|
||||
if (!((ctx.System != null && message.System?.Id == ctx.System.Id) || message.Message.Sender == ctx.Author.Id))
|
||||
throw new PKError("You can only delete your own messages.");
|
||||
|
||||
await ctx.Rest.DeleteMessage(message.Message.Channel, message.Message.Mid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue