You can use !embed color [hex value] to customize the embed color, !embed title [title] to customize the title, !embed description [description] to customize the embed description, and finally !embed generate to get your customized embed
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.content.startsWith('!embed color')) {
const args = context.params.event.content.split(' ').slice(2);
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `Color`,
description: `The Embed color Is This!`,
color: parseInt(args, 16),
},
});
await lib.utils.kv['@0.1.16'].set({
key: `color`,
value: parseInt(args, 16),
});
}
if (context.params.event.content.startsWith('!embed title')) {
const args = context.params.event.content.split(' ').slice(2).join(' ');
let color = await lib.utils.kv['@0.1.16'].get({
key: `color`,
defaultValue: 0x000000,
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `**${args}**`,
description: `This is the Embed Title!`,
color: color,
},
});
await lib.utils.kv['@0.1.16'].set({
key: `title`,
value: args,
});
}
if (context.params.event.content.startsWith('!embed description')) {
const args = context.params.event.content.split(' ').slice(2).join(' ');
let color = await lib.utils.kv['@0.1.16'].get({
key: `color`,
defaultValue: 0x000000,
});
let title = await lib.utils.kv['@0.1.16'].get({
key: `title`,
defaultValue: `This is the Title`,
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `**${title}**`,
description: `${args}`,
color: color,
},
});
await lib.utils.kv['@0.1.16'].set({
key: `descrption`,
value: args,
});
}
if (context.params.event.content.startsWith('!embed generate')) {
let color = await lib.utils.kv['@0.1.16'].get({
key: `color`,
defaultValue: 0x000000,
});
let title = await lib.utils.kv['@0.1.16'].get({
key: `title`,
defaultValue: `This is the Title`,
});
let description = await lib.utils.kv['@0.1.16'].get({
key: `description`,
defaultValue: `This is the Description`,
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `**${title}**`,
description: `${description}`,
color: color,
},
});
}