mirror of https://github.com/velour/catbase.git
counter: make matched things decrement sometimes
This commit is contained in:
parent
99817ad621
commit
7f183b4f2a
|
@ -541,7 +541,11 @@ func (p *CounterPlugin) checkMatch(c bot.Connector, message msg.Message) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
log.Debug().Msgf("About to update item: %#v", item)
|
log.Debug().Msgf("About to update item: %#v", item)
|
||||||
item.UpdateDelta(1)
|
delta := 1
|
||||||
|
if item.Count < 0 {
|
||||||
|
delta = -1
|
||||||
|
}
|
||||||
|
item.UpdateDelta(delta)
|
||||||
p.Bot.Send(c, bot.Message, channel, fmt.Sprintf("%s... %s has %d %s",
|
p.Bot.Send(c, bot.Message, channel, fmt.Sprintf("%s... %s has %d %s",
|
||||||
strings.Join(everyDayImShuffling([]string{"bleep", "bloop", "blop"}), "-"), nick, item.Count, itemName))
|
strings.Join(everyDayImShuffling([]string{"bleep", "bloop", "blop"}), "-"), nick, item.Count, itemName))
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue