Trainer Card Command

This commit is contained in:
Dragon Fire
2021-02-11 13:45:03 -05:00
parent 05eee3fdb5
commit 775f6bc57b
11 changed files with 226 additions and 68 deletions
+17
View File
@@ -0,0 +1,17 @@
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;
}
async parse(value) {
return this.client.pokemon.fetch(value);
}
};