Skip to content

Commit

Permalink
Fix message deletion for mass emoji pardoning
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Oct 3, 2024
1 parent d53ca4f commit 4f91464
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Events/MessageEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,16 @@ public static async Task MessageHandlerAsync(DiscordClient client, MockDiscordMe
if ((await GetPermLevelAsync(member)) == ServerPermLevel.Nothing && !Program.db.HashExists("emojiPardoned", message.Author.Id.ToString()))
{
await Program.db.HashSetAsync("emojiPardoned", member.Id.ToString(), false);
DiscordMessage msgOut;
string pardonOutput;
if (Program.cfgjson.UnrestrictedEmojiChannels.Count > 0)
msgOut = await channel.SendMessageAsync($"{Program.cfgjson.Emoji.Information} {message.Author.Mention}, if you want to play around with lots of emoji, please use <#{Program.cfgjson.UnrestrictedEmojiChannels[0]}> to avoid punishment.");
pardonOutput = $"{Program.cfgjson.Emoji.Information} {message.Author.Mention}, if you want to play around with lots of emoji, please use <#{Program.cfgjson.UnrestrictedEmojiChannels[0]}> to avoid punishment.";
else
if (wasAutoModBlock)
msgOut = await channel.SendMessageAsync($"{Program.cfgjson.Emoji.Information} {message.Author.Mention} Your message contained too many emoji.");
else
msgOut = await channel.SendMessageAsync($"{Program.cfgjson.Emoji.Information} {message.Author.Mention} Your message was automatically deleted for mass emoji.");
pardonOutput = $"{Program.cfgjson.Emoji.Information} {message.Author.Mention} Your message contained too many emoji.";
else
pardonOutput = $"{Program.cfgjson.Emoji.Information} {message.Author.Mention} Your message was automatically deleted for mass emoji.";

var msgOut = await WarningHelpers.SendPublicWarningMessageAndDeleteInfringingMessageAsync(message, pardonOutput, wasAutoModBlock);
await InvestigationsHelpers.SendInfringingMessaageAsync("investigations", message, reason, DiscordHelpers.MessageLink(msgOut), wasAutoModBlock: wasAutoModBlock);
return;
}
Expand Down

0 comments on commit 4f91464

Please sign in to comment.