More Stoof

This commit is contained in:
Daniel Odendahl Jr
2017-10-13 17:33:29 +00:00
parent 76111000b5
commit 981f59b1b1
40 changed files with 228 additions and 125 deletions
+2 -1
View File
@@ -55,7 +55,8 @@ module.exports = class QuizCommand extends Command {
answers.push(correct);
await msg.say(stripIndents`
**You have 15 seconds to answer this question.**
_${decodeURIComponent(body.results[0].category)}:_ ${decodeURIComponent(body.results[0].question)}
_${decodeURIComponent(body.results[0].category)}_
${decodeURIComponent(body.results[0].question)}
${type === 'boolean' ? 'True or False?' : ''}${type === 'multiple' ? `${list(shuffle(answers), 'or')}?` : ''}
`);
const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
+8 -3
View File
@@ -1,4 +1,5 @@
const { Command } = require('discord.js-commando');
const { MessageEmbed } = require('discord.js')
const snekfetch = require('snekfetch');
const { filterPkmn } = require('../../structures/Util');
@@ -10,7 +11,7 @@ module.exports = class WhosThatPokemonCommand extends Command {
group: 'games',
memberName: 'whos-that-pokemon',
description: 'Guess who that Pokémon is.',
clientPermissions: ['ATTACH_FILES']
clientPermissions: ['EMBED_LINKS']
});
}
@@ -20,8 +21,12 @@ module.exports = class WhosThatPokemonCommand extends Command {
const { body } = await snekfetch.get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}/`);
const names = body.names.map(name => name.name.toLowerCase());
const displayName = filterPkmn(body.names).name;
const image = `https://www.serebii.net/sunmoon/pokemon/${'000'.slice(body.id.toString().length)}${body.id}.png`;
await msg.say('**You have 15 seconds, who\'s that Pokémon?**', { files: [image] });
const id = `${'000'.slice(body.id.toString().length)}${body.id}`;
const embed = new MessageEmbed()
.setColor(0xED1C24)
.setTitle('You have 15 seconds, who\'s that Pokémon?')
.setImage(`https://www.serebii.net/sunmoon/pokemon/${id}.png`);
await msg.embed(embed);
const msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
max: 1,
time: 15000