From bcf49ece9797ad2b2c4c095e7367806b417de62b Mon Sep 17 00:00:00 2001 From: FloatingMilkshake Date: Sat, 17 Aug 2024 23:30:57 -0400 Subject: [PATCH] Hide button to show content for automodded msgs w/ too many lines --- Events/MessageEvent.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Events/MessageEvent.cs b/Events/MessageEvent.cs index 51138157..84d51ccc 100644 --- a/Events/MessageEvent.cs +++ b/Events/MessageEvent.cs @@ -672,7 +672,9 @@ public static async Task MessageHandlerAsync(DiscordClient client, MockDiscordMe output = $"{Program.cfgjson.Emoji.Information} {message.Author.Mention}, your message was deleted for containing too many lines.\n" + $"Please consider using a Pastebin-style website or <#{Program.cfgjson.UnrestrictedEmojiChannels[0]}> to avoid further punishment."; DiscordMessageBuilder messageBuilder = new(); - messageBuilder.WithContent(output).AddComponents(button); + messageBuilder.WithContent(output); + if (!wasAutoModBlock) + messageBuilder.AddComponents(button); DiscordMessage msg = await message.Channel.SendMessageAsync(messageBuilder); await Program.db.HashSetAsync("deletedMessageReferences", msg.Id, message.Content); await InvestigationsHelpers.SendInfringingMessaageAsync("investigations", message, reason, DiscordHelpers.MessageLink(msg), wasAutoModBlock: wasAutoModBlock); @@ -683,7 +685,9 @@ public static async Task MessageHandlerAsync(DiscordClient client, MockDiscordMe string output = $"{Program.cfgjson.Emoji.Denied} {message.Author.Mention} was automatically warned: **{reason.Replace("`", "\\`").Replace("*", "\\*")}**\n" + $"Please consider using a Pastebin-style website or <#{Program.cfgjson.UnrestrictedEmojiChannels[0]}> to avoid punishment."; DiscordMessageBuilder messageBuilder = new(); - messageBuilder.WithContent(output).AddComponents(button); + messageBuilder.WithContent(output); + if (!wasAutoModBlock) + messageBuilder.AddComponents(button); DiscordMessage msg = await message.Channel.SendMessageAsync(messageBuilder); var warning = await WarningHelpers.GiveWarningAsync(message.Author, client.CurrentUser, reason, contextMessage: msg, message.Channel, " automatically ");