mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 08:14:47 +02:00
Fix All the Crap
This commit is contained in:
@@ -16,10 +16,7 @@ module.exports = class DiscrimCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'discrim',
|
||||
prompt: 'Which discriminator would you like to search for?',
|
||||
type: 'string',
|
||||
validate: (str) => {
|
||||
str.match(/^[0-9]+$/) && str.length === 4;
|
||||
}
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -30,6 +27,7 @@ module.exports = class DiscrimCommand extends commando.Command {
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let userToSearch = args.discrim;
|
||||
if (!userToSearch.match(/^[0-9]+$/) || userToSearch.length !== 4) return message.channel.send(':x: Error! Invalid Discriminator!');
|
||||
let users = await this.client.users.filter(u => u.discriminator === userToSearch).map(u => u.username).sort();
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(`${users.length} Users with the discriminator: ${userToSearch}`)
|
||||
|
||||
@@ -16,10 +16,7 @@ module.exports = class PokedexCommand extends commando.Command {
|
||||
args: [{
|
||||
key: 'pokemon',
|
||||
prompt: 'What Pokémon would you like to get info on?',
|
||||
type: 'string',
|
||||
validate: (str) => {
|
||||
pokedex.name[str.toLowerCase()];
|
||||
}
|
||||
type: 'string'
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -30,6 +27,7 @@ module.exports = class PokedexCommand extends commando.Command {
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let pokemon = args.pokemon;
|
||||
if (!pokedex.name[pokemon.toLowerCase()]) return message.channel.send(':x: Error! This Pokémon is either not valid, or is not yet implemented!');
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle('Information')
|
||||
.setAuthor(`#${pokedex.index[pokemon]} ${pokedex.name[pokemon]}`, `http://www.serebii.net/pokedex-sm/icon/${pokedex.index[pokemon]}.png`)
|
||||
|
||||
Reference in New Issue
Block a user