mirror of
https://github.com/idanoo/GoDiscMoji
synced 2025-07-22 10:39:11 +00:00
Oh
This commit is contained in:
parent
0b7bb0cb34
commit
84f85832c0
1 changed files with 3 additions and 24 deletions
|
@ -97,33 +97,12 @@ func (bot *Bot) HandleAddReaction(discord *discordgo.Session, reaction *discordg
|
|||
}
|
||||
|
||||
if scrub.shouldScrub(reaction.GuildID, reaction.UserID) {
|
||||
slog.Info("Scrubbing with ID", "id", reaction.Emoji.ID, "name", reaction.Emoji.Name)
|
||||
err := b.DiscordSession.MessageReactionRemove(reaction.ChannelID, reaction.MessageID, reaction.Emoji.ID, reaction.UserID)
|
||||
if err != nil {
|
||||
slog.Info("Scrubbing with name", "id", reaction.Emoji.ID, "name", reaction.Emoji.Name, "err", err)
|
||||
err := b.DiscordSession.MessageReactionRemove(reaction.ChannelID, reaction.MessageID, reaction.Emoji.Name, reaction.UserID)
|
||||
if err != nil {
|
||||
slog.Error("Failed to remove emoji reaction", "err", err, "reaction", reaction)
|
||||
} else {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
err := b.DiscordSession.MessageReactionRemove(reaction.ChannelID, reaction.MessageID, reaction.Emoji.APIName(), reaction.UserID)
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
// slog.Error("Scrubbed emoji reaction", "id", reaction.Emoji.ID, "name", reaction.Emoji.Name)
|
||||
// ident := reaction.Emoji.ID
|
||||
// if ident == "" {
|
||||
// ident = reaction.Emoji.Name
|
||||
// }
|
||||
|
||||
// err := b.DiscordSession.MessageReactionRemove(reaction.ChannelID, reaction.MessageID, ident, reaction.UserID)
|
||||
// if err == nil {
|
||||
// return
|
||||
|
||||
// }
|
||||
|
||||
// Don't return and make sure we log if the remove failed
|
||||
// slog.Error("Error removing emoji reaction", "err", err, "reaction", reaction)
|
||||
slog.Error("Failed to remove emoji reaction", "err", err, "reaction", reaction)
|
||||
}
|
||||
|
||||
err := bot.Db.LogEmojiUsage(reaction.GuildID, reaction.ChannelID, reaction.MessageID, reaction.UserID, reaction.Emoji.ID, reaction.Emoji.Name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue