mirror of
https://github.com/cjdenio/jia.git
synced 2024-11-22 07:33:39 +00:00
Ignore threaded messages
This commit is contained in:
parent
d07d84c60e
commit
4e9225c2f9
1 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,11 @@ func onMessage(slackClient *slack.Client, event *slackevents.MessageEvent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ignore threaded messages.
|
||||||
|
if event.ThreadTimeStamp != "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Attempt to extract a positive number at the start of a string.
|
// Attempt to extract a positive number at the start of a string.
|
||||||
countPattern := regexp.MustCompile(`^\d+`)
|
countPattern := regexp.MustCompile(`^\d+`)
|
||||||
matchedNumber, err := strconv.Atoi(countPattern.FindString(event.Text))
|
matchedNumber, err := strconv.Atoi(countPattern.FindString(event.Text))
|
||||||
|
|
Loading…
Reference in a new issue