From 7cc2aab1f05fd6f508eec1c752d30d40a57ac9ed Mon Sep 17 00:00:00 2001 From: spiral Date: Fri, 14 Jan 2022 15:08:39 -0500 Subject: [PATCH] feat: remove 2000-character limit for proxied messages --- PluralKit.Bot/Commands/Message.cs | 3 --- PluralKit.Bot/Proxy/ProxyService.cs | 4 ---- PluralKit.Bot/Services/WebhookExecutorService.cs | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/PluralKit.Bot/Commands/Message.cs b/PluralKit.Bot/Commands/Message.cs index 38a1d539..ff5182df 100644 --- a/PluralKit.Bot/Commands/Message.cs +++ b/PluralKit.Bot/Commands/Message.cs @@ -56,9 +56,6 @@ 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."); diff --git a/PluralKit.Bot/Proxy/ProxyService.cs b/PluralKit.Bot/Proxy/ProxyService.cs index 89924cdc..1a66bc5d 100644 --- a/PluralKit.Bot/Proxy/ProxyService.cs +++ b/PluralKit.Bot/Proxy/ProxyService.cs @@ -66,10 +66,6 @@ public class ProxyService if (!_matcher.TryMatch(ctx, members, out var match, message.Content, message.Attachments.Length > 0, 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 if (!CheckBotPermissionsOrError(botPermissions, rootChannel.Id)) return false; diff --git a/PluralKit.Bot/Services/WebhookExecutorService.cs b/PluralKit.Bot/Services/WebhookExecutorService.cs index 9a0781e4..1e548942 100644 --- a/PluralKit.Bot/Services/WebhookExecutorService.cs +++ b/PluralKit.Bot/Services/WebhookExecutorService.cs @@ -99,7 +99,7 @@ public class WebhookExecutorService private async Task ExecuteWebhookInner(Webhook webhook, ProxyRequest req, bool hasRetried = false) { var guild = await _cache.GetGuild(req.GuildId); - var content = req.Content.Truncate(2000); + var content = req.Content.Truncate(4000); var allowedMentions = content.ParseMentions(); if (!req.AllowEveryone)