Files
xiao/types/pokemon.js
T
Dragon Fire eb52d56bd5 Fix lint
2021-02-11 13:46:39 -05:00

18 lines
370 B
JavaScript

const { ArgumentType } = require('discord.js-commando');
module.exports = class PokemonArgumentType extends ArgumentType {
constructor(client) {
super(client, 'pokemon');
}
async validate(value) {
const data = await this.client.pokemon.fetch(value);
if (!data) return false;
return true;
}
parse(value) {
return this.client.pokemon.fetch(value);
}
};