Merge pull request #327 from spiralw/fix/msg-edit-dm

Fix error when trying to edit message in DM without link
This commit is contained in:
Astrid 2021-05-08 21:38:33 +02:00 committed by GitHub
commit 74128ee4c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,9 @@ namespace PluralKit.Bot
return msg.Message; return msg.Message;
} }
if (ctx.Guild == null)
throw new PKError("You must use a message link to edit messages in DMs.");
var recent = await FindRecentMessage(ctx); var recent = await FindRecentMessage(ctx);
if (recent == null) if (recent == null)
throw new PKError("Could not find a recent message to edit."); throw new PKError("Could not find a recent message to edit.");