mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 22:32:50 +02:00
args and more
This commit is contained in:
@@ -11,11 +11,19 @@ module.exports = class RandomNameGen extends commando.Command {
|
||||
group: 'response',
|
||||
memberName: 'name',
|
||||
description: 'Generates a random name (;name Male)',
|
||||
examples: [';name', ';name male', ';name female']
|
||||
examples: [';name', ';name male', ';name female'],
|
||||
args: [{
|
||||
key: 'gender',
|
||||
prompt: 'Which gender do you want to generate a name for?',
|
||||
type: 'string',
|
||||
validate: (str) => {
|
||||
str.toLowerCase() === 'male' || str.toLowerCase() === 'female';
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
run(message, args) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
}
|
||||
@@ -26,16 +34,12 @@ module.exports = class RandomNameGen extends commando.Command {
|
||||
randomFirstFemale = randomFirstFemale[Math.floor(Math.random() * randomFirstFemale.length)];
|
||||
let randomLast = ["Walker", "Tworni", "Ross", "Smith", "Odendahl", "Deere", "Brown", "Williams", "Jones", "Miles", "Moss", "Roberto", "McFly", "McDonald", "Lewis", "Armstrong", "Stevenson", "Schwarzenegger", "Robinson", "Parker", "Piper", "Johnson", "Brantley", "Stewart", "Ree", "Talbot", "Seville", "Peace", "Spielberg", "Baggins", "Wilborn", "Vankirk", "Shireman", "Jimerson", "Masters", "Hack", "Satcher", "Younkin", "Aguila", "Duffey", "Burgin", "Highfall", "Wee", "Solari", "Tomaselli", "Basler", "Difranco", "Latch", "Rives", "Dolan", "Abraham", "Holter", "Portugal", "Lininger", "Holst", "Mccroy", "Follmer", "Hotchkiss", "Gassaway", "Wang", "Agron", "Raasch", "Gourd", "Czaja", "Marquart", "Papadopoulos", "Ringer", "Lax", "Sperling", "Galusha", "Alston"];
|
||||
randomLast = randomLast[Math.floor(Math.random() * randomLast.length)];
|
||||
let randomFirstBoth = [randomFirstMale, randomFirstFemale];
|
||||
randomFirstBoth = randomFirstBoth[Math.floor(Math.random() * randomFirstBoth.length)];
|
||||
if (message.content.toLowerCase().split(" ").slice(1).includes("male")) {
|
||||
let gender = args.gender;
|
||||
if (gender === "male") {
|
||||
return message.channel.send(`${randomFirstMale} ${randomLast}`);
|
||||
}
|
||||
else if (message.content.toLowerCase().split(" ").slice(1).includes("female")) {
|
||||
else if (gender === "female") {
|
||||
return message.channel.send(`${randomFirstFemale} ${randomLast}`);
|
||||
}
|
||||
else {
|
||||
return message.channel.send(`${randomFirstBoth} ${randomLast}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user