Skip to content

Commit

Permalink
Hide button to show content for automodded msgs w/ too many lines
Browse files Browse the repository at this point in the history
  • Loading branch information
FloatingMilkshake committed Aug 18, 2024
1 parent 4d0ca39 commit bcf49ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Events/MessageEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 ");
Expand Down

0 comments on commit bcf49ec

Please sign in to comment.