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
+2 -4
View File
@@ -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}`)
+2 -4
View File
@@ -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`)