From b2e7f383b500cc5f3670481c656efecfd4ea8bcf Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sun, 16 Mar 2025 12:00:13 -0700 Subject: [PATCH] Chatbot: Avoid upvoting a negative or possibly mean emoji --- client/handlers.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/handlers.go b/client/handlers.go index 15f2511..2b496ac 100644 --- a/client/handlers.go +++ b/client/handlers.go @@ -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 {