mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
25 lines
410 B
Go
25 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",
|
||
|
)
|
||
|
})
|
||
|
}
|