Add examples

This commit is contained in:
Dragon Fire
2024-05-16 17:16:00 -04:00
parent 9d00180cb3
commit 986d5d90fb
28 changed files with 138 additions and 32 deletions
+6
View File
@@ -1,4 +1,5 @@
const Argument = require('../framework/ArgumentType');
const examples = ['Pikachu', 'Bulbasaur', 'Victini', 'Flygon'];
module.exports = class PokemonArgument extends Argument {
constructor(client) {
@@ -14,4 +15,9 @@ module.exports = class PokemonArgument extends Argument {
parse(value) {
return this.client.pokemon.fetch(value);
}
example() {
if (this.client.pokemon.size) return this.client.pokemon.random().name;
return examples[Math.floor(Math.random() * examples.length)];
}
};