mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
[core] Fix: Accept 1s cooldown, fix user and channel cooldowns
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
6ce8375fa5
commit
58b2f17885
1 changed files with 3 additions and 1 deletions
|
@ -277,7 +277,9 @@ func (c *configFile) fixDurations() {
|
|||
|
||||
// Fix rules
|
||||
for _, r := range c.Rules {
|
||||
r.ChannelCooldown = c.fixedDurationPtr(r.ChannelCooldown)
|
||||
r.Cooldown = c.fixedDurationPtr(r.Cooldown)
|
||||
r.UserCooldown = c.fixedDurationPtr(r.UserCooldown)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -289,7 +291,7 @@ func (configFile) fixedDuration(d time.Duration) time.Duration {
|
|||
}
|
||||
|
||||
func (configFile) fixedDurationPtr(d *time.Duration) *time.Duration {
|
||||
if d == nil || *d > time.Second {
|
||||
if d == nil || *d >= time.Second {
|
||||
return d
|
||||
}
|
||||
fd := *d * time.Second
|
||||
|
|
Loading…
Reference in a new issue