mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Who's That Pokemon Accept many languages
This commit is contained in:
@@ -19,7 +19,8 @@ module.exports = class WhosThatPokemonCommand extends Command {
|
||||
const pokemon = Math.floor(Math.random() * 721) + 1;
|
||||
const { body } = await snekfetch
|
||||
.get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}`);
|
||||
const name = filterPkmn(body.names).name.toLowerCase();
|
||||
const names = body.names.map(name => name.name.toLowerCase());
|
||||
const name = filterPkmn(body.names).name;
|
||||
const id = `${'000'.slice(body.id.toString().length)}${body.id}`;
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle('You have 15 seconds, who\'s that Pokémon?')
|
||||
@@ -31,7 +32,7 @@ module.exports = class WhosThatPokemonCommand extends Command {
|
||||
time: 15000
|
||||
});
|
||||
if (!msgs.size) return msg.say(`Time! It was ${name}, sorry!`);
|
||||
if (msgs.first().content.toLowerCase() !== name) return msg.say(`Nope, sorry, it's ${name}.`);
|
||||
if (!names.includes(msgs.first().content.toLowerCase())) return msg.say(`Nope, sorry, it's ${name}.`);
|
||||
return msg.say('Nice job! 10/10! You deserve some cake!');
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "31.2.0",
|
||||
"version": "31.2.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user