move two commands from index to chatCommands

This commit is contained in:
Flummi 2023-07-20 13:04:08 +00:00
parent fbb201c5f8
commit 743492d093
2 changed files with 10 additions and 11 deletions

View File

@ -159,6 +159,16 @@ p.run = function (o) {
if ({b:/[^01]/,o:/[^0-7]/,d:/[^\d]/,h:/[^\da-fA-F]/}[o.cmd[0]].test(o.args)) return false; if ({b:/[^01]/,o:/[^0-7]/,d:/[^\d]/,h:/[^\da-fA-F]/}[o.cmd[0]].test(o.args)) return false;
client.say(o.to, o.from + ": " + parseInt(o.args, {b:2,o:8,d:10,h:16}[o.cmd[0]]).toString({b:2,o:8,d:10,h:16}[o.cmd[2]])); client.say(o.to, o.from + ": " + parseInt(o.args, {b:2,o:8,d:10,h:16}[o.cmd[0]]).toString({b:2,o:8,d:10,h:16}[o.cmd[2]]));
return true; return true;
case ".guuchan":
case ".vizon":
case ".lottery":
let values = new Array(29).fill().map((v,i)=>1+i);
let values_choices = new Array(6).fill().map(()=>values.splice(Math.random()*values.length|0,1)).sort((x,y)=>x-y).join(" ");
client.say(o.to, "/notice guuchan !bet " + values_choices);
return true;
case ".d":
client.say(o.to, o.from + ": the magic dice shows " + ((Math.random()*6|0)+1) + " eyes.");
return true;
} }
return false; return false;
}; };

View File

@ -174,10 +174,6 @@ irc.client.addListener("message", (from, to, message, raw) => {
return; return;
} }
if (/^!d$/.test(message)) {
client.say(to, from + ": the magic dice shows " + ((Math.random()*6|0)+1) + " eyes.");
}
if (/^a+[yi][yiou]*$/.test(message)) { if (/^a+[yi][yiou]*$/.test(message)) {
client.say(to, "ayy lmao"); client.say(to, "ayy lmao");
return; return;
@ -188,12 +184,5 @@ irc.client.addListener("message", (from, to, message, raw) => {
client.say(to, "[" + (ye?"x":" ") + "] ja [" + (ye?" ":"x") + "] nein | " + message); client.say(to, "[" + (ye?"x":" ") + "] ja [" + (ye?" ":"x") + "] nein | " + message);
return; return;
} }
if (~[".guuchan", ".vizon", ".lottery"].indexOf(message)) {
let values = new Array(29).fill().map((v,i)=>1+i);
let choices = new Array(6).fill().map(()=>values.splice(Math.random()*values.length|0,1)).sort((x,y)=>x-y).join(" ");
client.say(to, "/notice guuchan !bet " + choices);
return;
}
}); });