Local pokemon box images

This commit is contained in:
Dragon Fire
2024-03-28 21:41:06 -04:00
parent 5ee7eaf359
commit 7dfa92bb4a
8 changed files with 61 additions and 24 deletions
+8 -2
View File
@@ -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!`);
}
+8 -2
View File
@@ -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!`);
}
+8 -2
View File
@@ -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!`);
}
+8 -2
View File
@@ -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!`);
}
+8 -2
View File
@@ -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!`);
}