mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-08 16:20:02 +00:00
Use templating on counter name
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
58e984a4f4
commit
87f8fd84e2
1 changed files with 6 additions and 1 deletions
|
@ -11,13 +11,18 @@ func init() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
counterName, err := formatMessage(*r.Counter, m, ruleDef, nil)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "preparing response")
|
||||||
|
}
|
||||||
|
|
||||||
var counterStep int64 = 1
|
var counterStep int64 = 1
|
||||||
if r.CounterStep != nil {
|
if r.CounterStep != nil {
|
||||||
counterStep = *r.CounterStep
|
counterStep = *r.CounterStep
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors.Wrap(
|
return errors.Wrap(
|
||||||
store.UpdateCounter(*r.Counter, counterStep, false),
|
store.UpdateCounter(counterName, counterStep, false),
|
||||||
"update counter",
|
"update counter",
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue