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