twitch-bot/action_counter.go
2020-12-21 01:33:57 +01:00

24 lines
410 B
Go

package main
import (
"github.com/go-irc/irc"
"github.com/pkg/errors"
)
func init() {
registerAction(func(c *irc.Client, m *irc.Message, r *ruleAction) error {
if r.Counter == nil {
return nil
}
var counterStep int64 = 1
if r.CounterStep != nil {
counterStep = *r.CounterStep
}
return errors.Wrap(
store.UpdateCounter(*r.Counter, counterStep, false),
"update counter",
)
})
}