From 992e4afe4450f502831da2cb910e2241545d9217 Mon Sep 17 00:00:00 2001 From: Tyler Hawkins <3319104+tyzbit@users.noreply.github.com> Date: Mon, 9 May 2022 20:07:52 -0400 Subject: [PATCH] =?UTF-8?q?nit:=20require=20=F0=9F=8F=9B=20emoji=20in=20or?= =?UTF-8?q?der=20to=20act=20on=20=F0=9F=94=81=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot/bot.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot/bot.go b/bot/bot.go index 6562e1f..76757e1 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -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)