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}!`);
}
+4 -4
View File
@@ -15,10 +15,7 @@ module.exports = class RandomNameGen extends commando.Command {
args: [{
key: 'gender',
prompt: 'Which gender do you want to generate a name for?',
type: 'string',
validate: (str) => {
str.toLowerCase() === 'male' || str.toLowerCase() === 'female';
}
type: 'string'
}]
});
}
@@ -41,5 +38,8 @@ module.exports = class RandomNameGen extends commando.Command {
else if (gender === "female") {
return message.channel.send(`${randomFirstFemale} ${randomLast}`);
}
else {
return message.channel.send(':x: Error! Please set either male or female!');
}
}
};