mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
const Command = require('../../framework/Command');
|
||
const { EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||
|
||
module.exports = class PokedexMoveCommand extends Command {
|
||
constructor(client) {
|
||
super(client, {
|
||
name: 'pokedex-move',
|
||
aliases: ['pokemon-move', 'pokémon-move', 'pokédex-move', 'pkmn-move'],
|
||
group: 'pokedex',
|
||
description: 'Searches the Pokédex for a Pokémon move.',
|
||
clientPermissions: [PermissionFlagsBits.EmbedLinks],
|
||
credit: [
|
||
{
|
||
name: 'Pokémon',
|
||
url: 'https://www.pokemon.com/us/',
|
||
reason: 'Original Game'
|
||
},
|
||
{
|
||
name: 'PokéAPI',
|
||
url: 'https://pokeapi.co/',
|
||
reason: 'API'
|
||
}
|
||
],
|
||
args: [
|
||
{
|
||
key: 'move',
|
||
type: 'string'
|
||
}
|
||
]
|
||
});
|
||
}
|
||
|
||
async run(msg, { move }) {
|
||
const data = await this.client.pokemon.moves.fetch(move);
|
||
if (!data) return msg.say('Could not find any results.');
|
||
const embed = new EmbedBuilder()
|
||
.setColor(0xED1C24)
|
||
.setTitle(data.name)
|
||
.setDescription(data.description ? data.cleanDescription : 'No description available.')
|
||
.addField('❯ Accuracy', `${data.accuracy}%`, true)
|
||
.addField('❯ Power', data.power.toString() || '???', true)
|
||
.addField('❯ PP', data.pp.toString(), true)
|
||
.addField('❯ Type', data.type.toString(), true)
|
||
.addField('❯ Contest Type', data.contestType || 'N/A', true)
|
||
.addField('❯ Class', data.class, true);
|
||
return msg.embed(embed);
|
||
}
|
||
};
|