mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
18 lines
376 B
JavaScript
18 lines
376 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;
|
|
}
|
|
|
|
async parse(value) {
|
|
return this.client.pokemon.fetch(value);
|
|
}
|
|
};
|