Random Fixes

This commit is contained in:
Daniel Odendahl Jr
2017-03-24 02:50:42 +00:00
parent 75425d6cda
commit 9a4abf428b
7 changed files with 14 additions and 39 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ module.exports = class CoinFlipCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let coin = ['Heads', 'Tails'];
let coin = ['heads', 'tails'];
coin = coin[Math.floor(Math.random() * coin.length)];
message.channel.send(`It landed on ${coin}`);
message.channel.send(`It landed on ${coin}!`);
}
};
+1 -1
View File
@@ -23,6 +23,6 @@ module.exports = class QuantumCoin extends commando.Command {
console.log(`[Command] ${message.content}`);
let qcoin = ['on nothing', 'on NaN', 'on 0', 'in the air', 'on null'];
qcoin = qcoin[Math.floor(Math.random() * qcoin.length)];
message.channel.send(`It landed ${qcoin}`);
message.channel.send(`It landed ${qcoin}.`);
}
};
+2 -2
View File
@@ -23,11 +23,11 @@ module.exports = class RollChooseCommand extends commando.Command {
let [value] = message.content.split(" ").slice(1);
if (!value) {
let roll = Math.floor(Math.random() * 6) + 1;
message.channel.send(`You rolled a ${roll}`);
message.channel.send(`You rolled a ${roll}.`);
}
else if (value.match(/^[0-9]+$/)) {
let roll = Math.floor(Math.random() * value) + 1;
message.channel.send(`You rolled a ${roll}`);
message.channel.send(`You rolled a ${roll}.`);
}
else {
message.channel.send(":x: Error! Your message either contains a number but the number is invalid, or the number is in the wrong place.\n:notepad_spiral: (Note: When using numbers such as 1,000, do not use a comma)");