Files
xiao/types/pokemon.js
T
2021-06-05 12:17:33 -04:00

18 lines
360 B
JavaScript

const Argument = require('../framework/ArgumentType');
module.exports = class PokemonArgument extends Argument {
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);
}
};