mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 23:05:04 +02:00
Fix All the Crap
This commit is contained in:
@@ -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}!`);
|
||||
}
|
||||
|
||||
@@ -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!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user