discord,js embed builder code example
Example 1: embed discord.js
const Discord = require('discord.js');
const exampleEmbed = new Discord.RichEmbed()
.setColor('#0099ff')
.setTitle('Some title')
.setURL('https://discord.js.org/')
.setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org')
.setDescription('Some description here')
.setThumbnail('https://i.imgur.com/wSTFkRM.png')
.addField('Regular field title', 'Some value here')
.addBlankField()
.addField('Inline field title', 'Some value here', true)
.addField('Inline field title', 'Some value here', true)
.addField('Inline field title', 'Some value here', true)
.setImage('https://i.imgur.com/wSTFkRM.png')
.setTimestamp()
.setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');
channel.send(exampleEmbed);
Example 2: discord bot embed message
message.channel.send({embed: {
color: 3447003,
author: {
name: client.user.username,
icon_url: client.user.avatarURL
},
title: "This is an embed",
url: "http://google.com",
description: "This is a test embed to showcase what they look like and what they can do.",
fields: [{
name: "Fields",
value: "They can have different fields with small headlines."
},
{
name: "Masked links",
value: "You can put [masked links](http://google.com) inside of rich embeds."
},
{
name: "Markdown",
value: "You can put all the *usual* **__Markdown__** inside of them."
}
],
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "© Example"
}
}
});