This will generate a random colour thumbnail image and embed colour with it's #HEX code (!random)
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let randomColour = await lib.http.request['@1.1.6'].get({
url: `https://api.popcat.xyz/randomcolor`,
});
let color = `0x${randomColour.data.hex}`;
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: ``,
embeds: [
{
type: 'rich',
title: `${randomColour.data.name}`,
description: `> **Colour Hex code:** \`#${randomColour.data.hex}\``,
color: parseInt(color),
footer: {
text: ``,
},
thumbnail: {
url: `${randomColour.data.image}`,
height: 0,
width: 0,
},
},
],
});