twitch-bot/action_counter.go

25 lines
410 B
Go
Raw Normal View History

2020-12-21 00:32:39 +00:00
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",
)
})
}