less spammy rain

This commit is contained in:
unek
2014-05-06 09:48:28 +02:00
parent 6c8e2e62e7
commit 4f9cdce82c
3 changed files with 22 additions and 7 deletions
+4 -3
View File
@@ -157,7 +157,7 @@ client.addListener('message', function(from, channel, message) {
msg.push(settings.messages[command][i].expand({}));
}
client.say(msg.join(', '));
client.say(from, msg.join(', '));
return;
}
@@ -215,9 +215,10 @@ client.addListener('message', function(from, channel, message) {
max = max ? Math.min(max, names.length) : names.length;
if(max == 0) return;
var whole_channel = false;
if(max == names.length) whole_channel = true;
names = names.slice(0, max);
if(amount / max < settings.coin.min_rain) {
client.say(channel, settings.messages.rain_too_small.expand({from: from, amount: amount, min_rain: settings.coin.min_rain * max}));
return;
@@ -232,7 +233,7 @@ client.addListener('message', function(from, channel, message) {
});
}
client.say(channel, settings.messages.rain.expand({name: from, amount: amount / max, list: names.join(', ')}));
client.say(channel, settings.messages.rain.expand({name: from, amount: amount / max, list: whole_channel ? 'the whole channel' : names.join(', ')}));
});
} else {
winston.info('%s tried to tip %s %d, but has only %d', from, to, amount, balance);