Common code for implementing Twitch bots.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
513 B

package bot
import (
"fmt"
"github.com/VictoriaMetrics/metrics"
)
func twitchMessagesCounter(user, kind string) *metrics.Counter {
return metrics.GetOrCreateCounter(fmt.Sprintf(`twitch_messages_total{user=%q,kind=%q}`, user, kind))
}
// ignoreStats contains IRC commands for which we don't keep counters
var ignoreStats = map[string]bool{
"CAP": true,
"PING": true,
"001": true,
"002": true,
"003": true,
"004": true,
"353": true,
"366": true,
"372": true,
"375": true,
"376": true,
}