Sends a message containing a random embed.
// authenticates you with the API standard library
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const embeds = [
{
type: 'rich',
title: 'This is one possible embed!',
description: '',
color: 0xAA0000
},
{
type: 'rich',
title: 'This is another',
description: 'With a description!',
color: 0x00AA00
},
{
type: 'rich',
title: 'This one is blue!',
description: '',
color: 0x0000AA
}
];
if (context.params.event.content.startsWith('!randomembed')) {
let randomEmbed = embeds[Math.floor(Math.random() * embeds.length)];
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: randomEmbed
});
}