mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 10:19:11 +02:00
Lots of stoof
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const snekfetch = require('snekfetch');
|
||||
const pokemon = require('../../assets/json/pokemon-fusion');
|
||||
|
||||
module.exports = class PokemonFusionCommand extends Command {
|
||||
@@ -35,7 +36,12 @@ module.exports = class PokemonFusionCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { body, palette }) {
|
||||
return msg.say({ files: [`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`] });
|
||||
async run(msg, { body, palette }) {
|
||||
try {
|
||||
const image = await snekfetch.get(`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`);
|
||||
return msg.say({ files: [{ attachment: image.body, name: 'pokemon-fusion.png' }] });
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user