From 239afd9b103105f9f6ad32a7b02a8f6fd3498cdf Mon Sep 17 00:00:00 2001 From: spiral Date: Fri, 7 May 2021 22:31:43 +0100 Subject: [PATCH] Fix error when trying to edit message in DM without link --- PluralKit.Bot/Commands/MessageEdit.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Bot/Commands/MessageEdit.cs b/PluralKit.Bot/Commands/MessageEdit.cs index c979bc59..3297eb85 100644 --- a/PluralKit.Bot/Commands/MessageEdit.cs +++ b/PluralKit.Bot/Commands/MessageEdit.cs @@ -67,6 +67,9 @@ namespace PluralKit.Bot 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); if (recent == null) throw new PKError("Could not find a recent message to edit.");