Skip to content

Commit

Permalink
Reaction autoremove: Add logging (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloatingMilkshake authored Nov 27, 2024
1 parent 7d1c41d commit 53e838e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ CLIPTOK_ANTIPHISHING_ENDPOINT=useyourimagination
CLOUDFLARED_TOKEN=ignoreifnotrelevant
USERNAME_CHECK_ENDPOINT=https://api.example.com/username
CLIPTALK_WEBHOOK=https://discord.com
REACTION_LOG_WEBHOOK=https://discord.com
UPTIME_KUMA_PUSH_URL=
TS_AUTHKEY=tskey-auth-asdfg-asdfghj
2 changes: 2 additions & 0 deletions Events/ReactionEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static async Task OnReaction(DiscordClient _, MessageReactionAddedEventAr
unban_msg_rx.IsMatch(targetMessage.Content))
{
await targetMessage.DeleteReactionAsync(e.Emoji, e.User);
var emoji = e.Emoji.Id != 0 ? $"[{e.Emoji.Name}](<{e.Emoji.Url}>)" : e.Emoji.ToString();
await LogChannelHelper.LogMessageAsync("reactions", $"{cfgjson.Emoji.Deleted} Removed reaction {emoji} from [this message]({e.Message.JumpLink}) by {e.User.Mention}");
return;
}

Expand Down
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@
},
"nicknames": {
"channelId": 1280688061528674314
},
"reactions": {
"webhookEnvVar": "REACTION_LOG_WEBHOOK",
"channelId": 1311084236702482542
}
},
"botOwners": [
Expand Down

0 comments on commit 53e838e

Please sign in to comment.