Random Cute Red panda images that are posted to your discord server when the command -rpanda is put. Get to say aww when you see these cute red pandas!
// authenticates you with the API standard library
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let request = await lib.http.request['@1.1.6'].get({
url: `https://some-random-api.ml/img/red_panda`, //api url to get responses
});
console.log(request);
if (request.statusCode !== 200) {
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `Uh oh something went wrong out of the blue!`,
});
} else {
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `A cute redpanda is here! ${request.data.link}`, //sends a random image of a redpanda
});
}