mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Trainer Card Command
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user