mirror of
https://github.com/cjdenio/jia.git
synced 2025-05-12 00:23:06 +00:00
Update handlers.go
**untested** code to block a botter
This commit is contained in:
parent
6f1223cd84
commit
7cad95ae50
1 changed files with 13 additions and 0 deletions
|
@ -115,6 +115,19 @@ func onMessage(slackClient *slack.Client, event *slackevents.MessageEvent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Number Basher
|
||||||
|
if event.User == "U042MP4PJ5U" && time.Since(lastCountAt).Seconds() < 4 {
|
||||||
|
slackClient.AddReaction("bangbang", slack.ItemRef{
|
||||||
|
Channel: event.Channel,
|
||||||
|
Timestamp: event.TimeStamp,
|
||||||
|
})
|
||||||
|
slackClient.AddReaction("robot_face", slack.ItemRef{
|
||||||
|
Channel: event.Channel,
|
||||||
|
Timestamp: event.TimeStamp,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Finally!
|
// Finally!
|
||||||
redisClient.Set("last_valid_number", matchedNumber, 0)
|
redisClient.Set("last_valid_number", matchedNumber, 0)
|
||||||
redisClient.Set("last_valid_ts", event.TimeStamp, 0)
|
redisClient.Set("last_valid_ts", event.TimeStamp, 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue