Sends an image of a cute dog to your channel when you type "!dog". Uses https://dog.ceo/ for images.
// authenticates you with the API standard library
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.content.startsWith('!dog')) {
let dogImageResponse = await lib.http.request['@1.1.5'].get({
url: `https://dog.ceo/api/breeds/image/random`
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `Here is a cute dog!`,
embed: {
image: {
url: dogImageResponse.data.message
}
}
});
}