celesteblocker

This commit is contained in:
Caleb Denio 2022-08-23 15:33:16 -04:00
parent 0a74865977
commit 33af99f6b6
No known key found for this signature in database
GPG key ID: D2E75BDDE8F717AD

View file

@ -90,20 +90,20 @@ func onMessage(slackClient *slack.Client, event *slackevents.MessageEvent) {
return return
} }
// kog detection // kog + celeste detection
lastCountAtInt, err := redisClient.Get("last_count_at").Int64() lastCountAtInt, err := redisClient.Get("last_count_at").Int64()
if err != nil { if err != nil {
log.Println(err) log.Println(err)
} }
lastCountAt := time.Unix(lastCountAtInt, 0) lastCountAt := time.Unix(lastCountAtInt, 0)
if event.User == "UR6P49Q79" { if event.User == "UR6P49Q79" || event.User == "U02KYLBLKR9" {
fmt.Println("Kogbot detected.") fmt.Println("kogcelestebot detected.")
fmt.Printf("Time: %v\n", time.Since(lastCountAt).Seconds()) fmt.Printf("Time: %v\n", time.Since(lastCountAt).Seconds())
fmt.Printf("Contains 69: %v\n", strings.Contains(strconv.Itoa(matchedNumber), "69")) fmt.Printf("Contains 69: %v\n", strings.Contains(strconv.Itoa(matchedNumber), "69"))
} }
if event.User == "UR6P49Q79" && time.Since(lastCountAt).Seconds() < 4 && strings.Contains(strconv.Itoa(matchedNumber), "69") { if (event.User == "UR6P49Q79" || event.User == "U02KYLBLKR9") && time.Since(lastCountAt).Seconds() < 4 /* && strings.Contains(strconv.Itoa(matchedNumber), "69") */ {
slackClient.AddReaction("bangbang", slack.ItemRef{ slackClient.AddReaction("bangbang", slack.ItemRef{
Channel: event.Channel, Channel: event.Channel,
Timestamp: event.TimeStamp, Timestamp: event.TimeStamp,