mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Choose Changes
This commit is contained in:
@@ -20,11 +20,12 @@ module.exports = class ChooseCommand extends commando.Command {
|
|||||||
}
|
}
|
||||||
console.log("[Command] " + message.content);
|
console.log("[Command] " + message.content);
|
||||||
if(message.content.includes(" | ")) {
|
if(message.content.includes(" | ")) {
|
||||||
let choice2 = message.content.split("|").slice(1).join(" ");
|
let choices = message.content.split(" | ");
|
||||||
let choice1 = " " + message.content.replace(choice2, "").split(" ").slice(1).join(" ");
|
let choice1 = choices[0];
|
||||||
let coin = [choice1, choice2];
|
let choice2 = choices[1];
|
||||||
coin = coin[Math.floor(Math.random() * coin.length)];
|
let randomChoice = [choice1, choice2];
|
||||||
message.channel.send("I choose" + coin.replace("|", ""));
|
randomChoice = randomChoice[Math.floor(Math.random() * randomChoice.length)];
|
||||||
|
message.channel.send("I choose " + randomChoice);
|
||||||
} else {
|
} else {
|
||||||
message.channel.send(":x: Split your two choices with a ' | '!");
|
message.channel.send(":x: Split your two choices with a ' | '!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user