Embedless Who's that Pokemon

This commit is contained in:
Daniel Odendahl Jr
2017-10-11 17:41:14 +00:00
parent cbfe26a384
commit a0261c1f03
3 changed files with 5 additions and 12 deletions
+3 -9
View File
@@ -1,5 +1,4 @@
const { Command } = require('discord.js-commando');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
const { filterPkmn } = require('../../structures/Util');
@@ -10,8 +9,7 @@ module.exports = class WhosThatPokemonCommand extends Command {
aliases: ['who-pokemon', 'whos-that-pokémon', 'who-pokémon'],
group: 'games',
memberName: 'whos-that-pokemon',
description: 'Guess who that Pokémon is.',
clientPermissions: ['EMBED_LINKS']
description: 'Guess who that Pokémon is.'
});
}
@@ -21,12 +19,8 @@ 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 id = `${'000'.slice(body.id.toString().length)}${body.id}`;
const embed = new MessageEmbed()
.setTitle('You have 15 seconds, who\'s that Pokémon?')
.setColor(0xED1C24)
.setImage(`https://www.serebii.net/sunmoon/pokemon/${id}.png`);
await msg.embed(embed);
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 msgs = await msg.channel.awaitMessages(res => res.author.id === msg.author.id, {
max: 1,
time: 15000
+1 -2
View File
@@ -45,8 +45,7 @@ module.exports = class HelpCommand extends Command {
.setDescription(`Use ${msg.usage('<command>')} to view detailed information about a command.`)
.setColor(0x00AE86);
for (const group of this.client.registry.groups.values()) {
embed.addField(` ${group.name}`,
group.commands.map(c => c.name).join(', ') || 'None');
embed.addField(` ${group.name}`, group.commands.map(c => c.name).join(', ') || 'None');
}
try {
await msg.direct({ embed });
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "47.0.0",
"version": "47.0.1",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {