Reset counter when chance is set

This commit is contained in:
Marco Loewe 2021-09-03 19:11:21 +02:00
parent 26128ab966
commit 0f65dcfdee

3
bot.js
View File

@ -110,6 +110,9 @@ function onMessageHandler (channel, userstate, message, self) {
configurations[channel] = config;
fs.writeFileSync('buttsbot.config', JSON.stringify(configurations));
client.say(channel, "Chance set to " + value + "%");
messageCounter[channel] = { total: 0, converted: 0 };
fs.writeFileSync('counter', JSON.stringify(messageCounter));
} else {
client.say(channel, "Expected a number, got " + value);
}