Reset counter when chance is set
This commit is contained in:
parent
26128ab966
commit
0f65dcfdee
3
bot.js
3
bot.js
|
|
@ -110,6 +110,9 @@ function onMessageHandler (channel, userstate, message, self) {
|
||||||
configurations[channel] = config;
|
configurations[channel] = config;
|
||||||
fs.writeFileSync('buttsbot.config', JSON.stringify(configurations));
|
fs.writeFileSync('buttsbot.config', JSON.stringify(configurations));
|
||||||
client.say(channel, "Chance set to " + value + "%");
|
client.say(channel, "Chance set to " + value + "%");
|
||||||
|
|
||||||
|
messageCounter[channel] = { total: 0, converted: 0 };
|
||||||
|
fs.writeFileSync('counter', JSON.stringify(messageCounter));
|
||||||
} else {
|
} else {
|
||||||
client.say(channel, "Expected a number, got " + value);
|
client.say(channel, "Expected a number, got " + value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user