Chatbot: Avoid upvoting a negative or possibly mean emoji

This commit is contained in:
Noah 2025-03-16 12:00:13 -07:00
parent 23a73620b9
commit b2e7f383b5

View File

@ -279,6 +279,16 @@ func (h *BotHandlers) OnReact(msg messages.Message) {
return
}
// Avoid upvoting any 'negative' or mean emoji.
negativeEmoji := []string{
"🤢", "🤮", "😡", "🤬", "💩", "🤡", "🖕", "👎",
}
for _, check := range negativeEmoji {
if strings.Contains(msg.Message, check) {
return
}
}
// Sanity check that we can actually see the message being reacted to: so we don't
// upvote reactions posted to messageIDs in other peoples' DM threads.
if _, ok := h.getMessageByID(msg.MessageID); !ok {