mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-10 19:04:42 +02:00
Local pokemon box images
This commit is contained in:
@@ -59,10 +59,16 @@ module.exports = class PokedexLocationCommand extends Command {
|
||||
: 'Location Unknown';
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xED1C24)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, pokemon.boxImageURL, pokemon.serebiiURL)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, 'attachment://box.png', pokemon.serebiiURL)
|
||||
.setDescription(desc)
|
||||
.setThumbnail(pokemon.spriteImageURL);
|
||||
return msg.embed(embed);
|
||||
return msg.channel.send({
|
||||
embeds: [embed],
|
||||
files: [{
|
||||
attachment: await pokemon.generateBoxImage(),
|
||||
name: 'box.png'
|
||||
}]
|
||||
});
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
@@ -59,11 +59,17 @@ module.exports = class PokedexMovesetCommand extends Command {
|
||||
if (!pokemon.moveSet.length) return msg.say('This Pokémon\'s moves are not yet documented.');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xED1C24)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, pokemon.boxImageURL, pokemon.serebiiURL)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, 'attachment://box.png', pokemon.serebiiURL)
|
||||
.setDescription(pokemon.moveSet.map(move => `**Level ${move.level}:** ${move.move.name}`).join('\n'))
|
||||
.setThumbnail(pokemon.spriteImageURL)
|
||||
.setFooter(`Moveset data taken from ${versions[pokemon.moveSetVersion]}.`);
|
||||
return msg.embed(embed);
|
||||
return msg.channel.send({
|
||||
embeds: [embed],
|
||||
files: [{
|
||||
attachment: await pokemon.generateBoxImage(),
|
||||
name: 'box.png'
|
||||
}]
|
||||
});
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ module.exports = class PokedexCommand extends Command {
|
||||
.setColor(0xED1C24)
|
||||
.setAuthor(
|
||||
`#${pokemon.displayID} - ${pokemon.name}`,
|
||||
pokemon.formBoxImageURL(variety.id),
|
||||
'attachment://box.png',
|
||||
pokemon.serebiiURL
|
||||
)
|
||||
.setThumbnail(pokemon.formSpriteImageURL(variety.id))
|
||||
@@ -96,7 +96,13 @@ module.exports = class PokedexCommand extends Command {
|
||||
|
||||
**Forms Available:** ${displayForms.map(vrity => `\`${vrity.name || 'Normal'}\``).join(', ')}
|
||||
`);
|
||||
return msg.embed(embed);
|
||||
return msg.channel.send({
|
||||
embeds: [embed],
|
||||
files: [{
|
||||
attachment: await pokemon.generateBoxImage(),
|
||||
name: 'box.png'
|
||||
}]
|
||||
});
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ module.exports = class PokedexCommand extends Command {
|
||||
}).join(' -> ');
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xED1C24)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, pokemon.boxImageURL, pokemon.serebiiURL)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, 'attachment://box.png', pokemon.serebiiURL)
|
||||
.setDescription(stripIndents`
|
||||
**${pokemon.genus}**
|
||||
${pokemon.entries.length ? pokemon.entries[Math.floor(Math.random() * pokemon.entries.length)] : 'No data.'}
|
||||
@@ -120,7 +120,13 @@ module.exports = class PokedexCommand extends Command {
|
||||
await reactIfAble(msg, this.client.user, '🔉');
|
||||
}
|
||||
}
|
||||
return msg.embed(embed);
|
||||
return msg.channel.send({
|
||||
embeds: [embed],
|
||||
files: [{
|
||||
attachment: await pokemon.generateBoxImage(),
|
||||
name: 'box.png'
|
||||
}]
|
||||
});
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ module.exports = class SmogonCommand extends Command {
|
||||
if (!pokemon.missingno) await pokemon.fetchSmogonTiers(...fetchGames);
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0xED1C24)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, pokemon.boxImageURL, pokemon.serebiiURL)
|
||||
.setAuthor(`#${pokemon.displayID} - ${pokemon.name}`, 'attachment://box.png', pokemon.serebiiURL)
|
||||
.setThumbnail(pokemon.spriteImageURL);
|
||||
for (const game of fetchGames) {
|
||||
embed.addField(`❯ ${games[game]}`,
|
||||
@@ -71,7 +71,13 @@ module.exports = class SmogonCommand extends Command {
|
||||
embed.addField('\u200B', '\u200B', true);
|
||||
}
|
||||
}
|
||||
return msg.embed(embed);
|
||||
return msg.channel.send({
|
||||
embeds: [embed],
|
||||
files: [{
|
||||
attachment: await pokemon.generateBoxImage(),
|
||||
name: 'box.png'
|
||||
}]
|
||||
});
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user