Changes to pity system

This commit is contained in:
Marco Loewe 2021-09-03 20:29:43 +02:00
parent 93c7d21123
commit 0269913a93

10
bot.js
View File

@ -236,6 +236,11 @@ function onMessageHandler (channel, userstate, message, self) {
counter.total++;
if (pityTracker[channel])
pityTracker[channel]++;
else
pityTracker[channel] = 1;
// random chance
// TODO: find a better alternative
var number = Math.random() * 100;
@ -276,11 +281,6 @@ function onMessageHandler (channel, userstate, message, self) {
});
client.say(channel, newMessage.trim());
} else {
if (pityTracker[channel])
pityTracker[channel]++;
else
pityTracker[channel] = 1;
}
console.log(channel + ": " + JSON.stringify(counter));