3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-11 21:39:37 +01:00
This commit is contained in:
reality 2016-04-24 00:14:54 +00:00
parent cfbb71faa6
commit 45a27904bd
2 changed files with 3 additions and 2 deletions

View File

@ -74,7 +74,8 @@ var dice = function(dbot) {
event.reply(rolls[i][0] + ": invalid dice spec"); event.reply(rolls[i][0] + ": invalid dice spec");
} else { } else {
if (rolls[i][1].length > 1) { if (rolls[i][1].length > 1) {
var total = " (total " + rolls[i][1].sum(); console.log(rolls);
var total = " (total " + _.reduce(rolls[i][1], function(memo, num){ return memo + num; }, 0);
if (rolls[i][2] != 0) { if (rolls[i][2] != 0) {
if (rolls[i][2] > 0) { if (rolls[i][2] > 0) {
total += " + "; total += " + ";

View File

@ -425,7 +425,7 @@ var commands = function(dbot) {
commands['~ckick'].regex = /^ckick (#[^ ]+ )?([^ ]+) ?(.*)?$/; commands['~ckick'].regex = /^ckick (#[^ ]+ )?([^ ]+) ?(.*)?$/;
commands['~nban'].regex = /^nban (\d[\d\.dhmsy]+)? ?([^ ]+) (.+)$/; commands['~nban'].regex = /^nban (\d[\d\.dhmsy]+)? ?([^ ]+) (.+)$/;
commands['~quiet'].regex = /^quiet (\d[\d\.hms]+)? ?(#[^ ]+ )?([^ ]+) ?(.*)?$/; commands['~quiet'].regex = /^quiet (\d[\d\.hmsy]+)? ?(#[^ ]+ )?([^ ]+) ?(.*)?$/;
commands['~timeout'].regex = /^timeout ([^ ]+) ?(.*)?$/; commands['~timeout'].regex = /^timeout ([^ ]+) ?(.*)?$/;
commands['~unquiet'].regex = /^unquiet (#[^ ]+ )?([^ ]+) ?$/; commands['~unquiet'].regex = /^unquiet (#[^ ]+ )?([^ ]+) ?$/;
commands['~votequiet'].regex = [/^votequiet ([^ ]+) (.+)$/, 3]; commands['~votequiet'].regex = [/^votequiet ([^ ]+) (.+)$/, 3];