From 91256368f57939e85b80137a3bb470bfc81416eb Mon Sep 17 00:00:00 2001 From: spiral Date: Tue, 7 Dec 2021 02:02:22 -0500 Subject: [PATCH] fix: throw error when pk;edit message is too long --- PluralKit.Bot/Commands/Message.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PluralKit.Bot/Commands/Message.cs b/PluralKit.Bot/Commands/Message.cs index e668251a..0262a51d 100644 --- a/PluralKit.Bot/Commands/Message.cs +++ b/PluralKit.Bot/Commands/Message.cs @@ -55,6 +55,9 @@ public class ProxiedMessage var newContent = ctx.RemainderOrNull().NormalizeLineEndSpacing(); + if (newContent.Length > 2000) + throw new PKError("PluralKit cannot proxy messages over 2000 characters in length."); + var originalMsg = await _rest.GetMessageOrNull(msg.Message.Channel, msg.Message.Mid); if (originalMsg == null) throw new PKError("Could not edit message.");