feat: remove 2000-character limit for proxied messages
This commit is contained in:
parent
d58cc216c0
commit
7cc2aab1f0
@ -56,9 +56,6 @@ 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.");
|
||||||
|
@ -66,10 +66,6 @@ public class ProxyService
|
|||||||
if (!_matcher.TryMatch(ctx, members, out var match, message.Content, message.Attachments.Length > 0,
|
if (!_matcher.TryMatch(ctx, members, out var match, message.Content, message.Attachments.Length > 0,
|
||||||
allowAutoproxy)) return false;
|
allowAutoproxy)) return false;
|
||||||
|
|
||||||
// this is hopefully temporary, so not putting it into a separate method
|
|
||||||
if (message.Content != null && message.Content.Length > 2000)
|
|
||||||
throw new PKError("PluralKit cannot proxy messages over 2000 characters in length.");
|
|
||||||
|
|
||||||
// Permission check after proxy match so we don't get spammed when not actually proxying
|
// Permission check after proxy match so we don't get spammed when not actually proxying
|
||||||
if (!CheckBotPermissionsOrError(botPermissions, rootChannel.Id))
|
if (!CheckBotPermissionsOrError(botPermissions, rootChannel.Id))
|
||||||
return false;
|
return false;
|
||||||
|
@ -99,7 +99,7 @@ public class WebhookExecutorService
|
|||||||
private async Task<Message> ExecuteWebhookInner(Webhook webhook, ProxyRequest req, bool hasRetried = false)
|
private async Task<Message> ExecuteWebhookInner(Webhook webhook, ProxyRequest req, bool hasRetried = false)
|
||||||
{
|
{
|
||||||
var guild = await _cache.GetGuild(req.GuildId);
|
var guild = await _cache.GetGuild(req.GuildId);
|
||||||
var content = req.Content.Truncate(2000);
|
var content = req.Content.Truncate(4000);
|
||||||
|
|
||||||
var allowedMentions = content.ParseMentions();
|
var allowedMentions = content.ParseMentions();
|
||||||
if (!req.AllowEveryone)
|
if (!req.AllowEveryone)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user