Skip to content

Commit

Permalink
nit: require πŸ› emoji in order to act on πŸ” messages
Browse files Browse the repository at this point in the history
  • Loading branch information
tyzbit committed May 10, 2022
1 parent b6a2b38 commit 992e4af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ func (bot *ArchiverBot) MessageReactionAdd(s *discordgo.Session, r *discordgo.Me
log.Errorf("problem handling archive request: %v", err)
}
}
if r.MessageReaction.Emoji.Name == "πŸ”" {
// Only handle a repeat reaction if the message has a "πŸ›οΈ" on it already
users, err := s.MessageReactions(r.ChannelID, r.MessageID, "πŸ›οΈ", 1, "","")
if err != nil {
log.Warnf("Error getting reactions for message id: %s, channel: %s", r.MessageID, r.ChannelID)
}
if r.MessageReaction.Emoji.Name == "πŸ”" && len(users) > 0 {
err := bot.handleArchiveRequest(s, r, true)
if err != nil {
log.Errorf("problem handling archive request: %v", err)
Expand Down

0 comments on commit 992e4af

Please sign in to comment.