Sends a smug anime GIF into your current channel
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const axios = require('axios');
if (context.params.event.content.startsWith(`${process.env.PREFIX}smug`)) {
const image = await axios('https://api.waifu.pics/sfw/smug').then((res) =>
res.data ? res.data.url : null
);
if (!image) {
return lib.discord.channels['@0.2.0'].messages.create({
content: `Oops sorry , something is wrong`,
channel_id: context.params.event.channel_id,
});
}
await lib.discord.channels['@0.2.0'].messages.create({
content: ``,
channel_id: context.params.event.channel_id,
embed: {
image: {url: image},
color: 0x3244a8,
},
});
}