fix: throw error when pk;edit message is too long

This commit is contained in:
spiral
2021-12-07 02:02:22 -05:00
parent cb1d4c98c7
commit 91256368f5

View File

@@ -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.");