Fix All the Crap

This commit is contained in:
Daniel Odendahl Jr
2017-03-25 04:52:59 +00:00
parent ebfbf31787
commit cb4abd7ac4
12 changed files with 42 additions and 59 deletions
+3 -1
View File
@@ -27,7 +27,9 @@ module.exports = class ChooseCommand extends commando.Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
console.log(`[Command] ${message.content}`);
let choices = args.choices.split(' | ');
let choices = args.choices;
if (!choices.includes(' | ')) return message.channel.send(':x: Error! Split your messages with a " | "!');
choices = choices.split(" | ");
choices = choices[Math.floor(Math.random() * choices.length)];
return message.channel.send(`I choose ${choices}!`);
}