From 44efc15b90533764d81672c2e341622f143f6ddb Mon Sep 17 00:00:00 2001 From: spiral Date: Thu, 3 Nov 2022 22:39:06 +0000 Subject: [PATCH] fix(bot): do not proxy the initial message in a forum post (#494) --- PluralKit.Bot/Proxy/ProxyService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Proxy/ProxyService.cs b/PluralKit.Bot/Proxy/ProxyService.cs index 4ab45e4f..abdd4180 100644 --- a/PluralKit.Bot/Proxy/ProxyService.cs +++ b/PluralKit.Bot/Proxy/ProxyService.cs @@ -118,6 +118,10 @@ public class ProxyService if (msg.Author.System == true || msg.Author.Bot || msg.WebhookId != null) throw new ProxyChecksFailedException("This message was not sent by a normal user."); + // Make sure this message does not start a forum thread + if (msg.Id == msg.ChannelId) + throw new ProxyChecksFailedException("This message is the initial message in a forum post, which PluralKit is unable to proxy correctly."); + // Make sure proxying is enabled here if (ctx.InBlacklist) throw new ProxyChecksFailedException( @@ -501,4 +505,4 @@ public class ProxyService { public ProxyChecksFailedException(string message) : base(message) { } } -} +} \ No newline at end of file