Skip to content

Commit

Permalink
Relay infringing message for mass emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Mar 29, 2021
1 parent 66f919c commit c0ec890
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,21 @@ async Task MessageCreated(DiscordClient client, MessageCreateEventArgs e)
if (matches.Count > cfgjson.MassEmojiThreshold)
{
e.Message.DeleteAsync();
DiscordChannel logChannel = await discord.GetChannelAsync(Program.cfgjson.LogChannel);
var embed = new DiscordEmbedBuilder()
.WithDescription(e.Message.Content)
.WithColor(new DiscordColor(0xf03916))
.WithTimestamp(e.Message.Timestamp)
.WithFooter(
$"User ID: {e.Author.Id}",
null
)
.WithAuthor(
$"{e.Author.Username}#{e.Author.Discriminator} in #{e.Channel.Name}",
null,
e.Author.AvatarUrl
);
logChannel.SendMessageAsync($"{cfgjson.Emoji.Denied} Deleted infringing message by {e.Author.Mention} in {e.Channel.Mention}:", embed);

if (Warnings.GetPermLevel(member) == ServerPermLevel.nothing && !db.HashExists("emojiPardoned", e.Message.Author.Id.ToString()))
{
Expand Down

0 comments on commit c0ec890

Please sign in to comment.