Add Pokedex Ability and Move

This commit is contained in:
Dragon Fire
2021-01-22 18:14:32 -05:00
parent 62230d41e3
commit 793ca59e18
11 changed files with 212 additions and 11 deletions
+48
View File
@@ -0,0 +1,48 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
module.exports = class PokedexAbilityCommand extends Command {
constructor(client) {
super(client, {
name: 'pokedex-ability',
aliases: ['pokemon-ability', 'pokémon-ability', 'pokédex-ability', 'pkmn-ability'],
group: 'pokedex',
memberName: 'pokedex-ability',
description: 'Searches the Pokédex for a Pokémon ability.',
clientPermissions: ['EMBED_LINKS'],
credit: [
{
name: 'Pokémon',
url: 'https://www.pokemon.com/us/',
reason: 'Original Game'
},
{
name: 'PokéAPI',
url: 'https://pokeapi.co/',
reason: 'API'
}
],
args: [
{
key: 'ability',
prompt: 'What ability would you like to get information on?',
type: 'string'
}
]
});
}
async run(msg, { ability }) {
try {
const data = await this.client.pokemon.abilities.fetch(ability);
if (!data) return msg.say('Could not find any results.');
const embed = new MessageEmbed()
.setColor(0xED1C24)
.setTitle(data.name)
.setDescription(data.description);
return msg.embed(embed);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};