Who's That Pokemon Accept many languages

This commit is contained in:
Daniel Odendahl Jr
2017-08-26 16:50:36 +00:00
parent 1a035be702
commit 4e03a1e710
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "31.2.0",
"version": "31.2.1",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {