fix: don't try deleting pk;msg -delete message in DMs

This commit is contained in:
spiral 2021-09-13 02:21:39 -04:00
parent 42422f475b
commit 2973325e12
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -137,7 +137,10 @@ namespace PluralKit.Bot
{ {
if (message.System.Id != ctx.System.Id) if (message.System.Id != ctx.System.Id)
throw new PKError("You can only delete your own messages."); throw new PKError("You can only delete your own messages.");
await ctx.Rest.DeleteMessage(message.Message.Channel, message.Message.Mid); await ctx.Rest.DeleteMessage(message.Message.Channel, message.Message.Mid);
if (ctx.Guild != null)
await ctx.Rest.DeleteMessage(ctx.Message); await ctx.Rest.DeleteMessage(ctx.Message);
return; return;
} }