Skip to content

Commit 53e838e

Browse files
Reaction autoremove: Add logging (#245)
1 parent 7d1c41d commit 53e838e

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ CLIPTOK_ANTIPHISHING_ENDPOINT=useyourimagination
44
CLOUDFLARED_TOKEN=ignoreifnotrelevant
55
USERNAME_CHECK_ENDPOINT=https://api.example.com/username
66
CLIPTALK_WEBHOOK=https://discord.com
7+
REACTION_LOG_WEBHOOK=https://discord.com
78
UPTIME_KUMA_PUSH_URL=
89
TS_AUTHKEY=tskey-auth-asdfg-asdfghj

Events/ReactionEvent.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public static async Task OnReaction(DiscordClient _, MessageReactionAddedEventAr
2424
unban_msg_rx.IsMatch(targetMessage.Content))
2525
{
2626
await targetMessage.DeleteReactionAsync(e.Emoji, e.User);
27+
var emoji = e.Emoji.Id != 0 ? $"[{e.Emoji.Name}](<{e.Emoji.Url}>)" : e.Emoji.ToString();
28+
await LogChannelHelper.LogMessageAsync("reactions", $"{cfgjson.Emoji.Deleted} Removed reaction {emoji} from [this message]({e.Message.JumpLink}) by {e.User.Mention}");
2729
return;
2830
}
2931

config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@
287287
},
288288
"nicknames": {
289289
"channelId": 1280688061528674314
290+
},
291+
"reactions": {
292+
"webhookEnvVar": "REACTION_LOG_WEBHOOK",
293+
"channelId": 1311084236702482542
290294
}
291295
},
292296
"botOwners": [

0 commit comments

Comments
 (0)