fix: throw error when pk;edit message is too long
This commit is contained in:
parent
cb1d4c98c7
commit
91256368f5
@ -55,6 +55,9 @@ public class ProxiedMessage
|
|||||||
|
|
||||||
var newContent = ctx.RemainderOrNull().NormalizeLineEndSpacing();
|
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);
|
var originalMsg = await _rest.GetMessageOrNull(msg.Message.Channel, msg.Message.Mid);
|
||||||
if (originalMsg == null)
|
if (originalMsg == null)
|
||||||
throw new PKError("Could not edit message.");
|
throw new PKError("Could not edit message.");
|
||||||
|
Loading…
Reference in New Issue
Block a user