From 4e9225c2f9bb5ef65035bc1e3572e3fdccedc76f Mon Sep 17 00:00:00 2001 From: Victor Truong Date: Thu, 30 Jul 2020 03:32:10 -0700 Subject: [PATCH] Ignore threaded messages --- pkg/jia/handlers.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/jia/handlers.go b/pkg/jia/handlers.go index 98effdb..553a250 100644 --- a/pkg/jia/handlers.go +++ b/pkg/jia/handlers.go @@ -24,6 +24,11 @@ func onMessage(slackClient *slack.Client, event *slackevents.MessageEvent) { return } + // Ignore threaded messages. + if event.ThreadTimeStamp != "" { + return + } + // Attempt to extract a positive number at the start of a string. countPattern := regexp.MustCompile(`^\d+`) matchedNumber, err := strconv.Atoi(countPattern.FindString(event.Text))