move two commands from index to chatCommands
This commit is contained in:
parent
fbb201c5f8
commit
743492d093
|
@ -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;
|
||||
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;
|
||||
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;
|
||||
};
|
||||
|
|
11
index.js
11
index.js
|
@ -174,10 +174,6 @@ irc.client.addListener("message", (from, to, message, raw) => {
|
|||
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)) {
|
||||
client.say(to, "ayy lmao");
|
||||
return;
|
||||
|
@ -188,12 +184,5 @@ irc.client.addListener("message", (from, to, message, raw) => {
|
|||
client.say(to, "[" + (ye?"x":" ") + "] ja [" + (ye?" ":"x") + "] nein | " + message);
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user