Simple Meow API Command / Bot Discord
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const axios = require('axios');
if (context.params.event.content.startsWith('-meow')) {
const image = await axios('https://nekos.life/api/v2/img/meow').then((res) =>
res.data ? res.data.url : null
);
if (!image)
return lib.discord.channels['@0.2.0'].messages.create({
content: `Error !, try now`,
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: 000000,
},
});
}