xxxxxxxxxx
/*
Need more help? Add me on discord: Dwagon#0069
Discord.js ^13.8.1
*/
// The embed itself
const embed = new MessageEmbed()
.setTitle("Title")
.setURL("https://www.codegrepper.com/") // The redirected URL when clicking on the title
.setDescription("Description")
.addField("Title of field", "Description of field", true) // When adding ", true" you enable the inline.
// or
.addFields(
{ name: "Title of field", value: "Description of field"}, // Inline disabled
{ name: "Title of field", value: "Description of field", inline: true} // Inline enabled
)
.setAuthor({ name: "Main title", iconURL: "https://i.imgur.com/2LUu1KL.png", url: "https://www.codegrepper.com/"})
.setImage("https://i.imgur.com/2LUu1KL.png")
.setThumbnail("https://i.imgur.com/2LUu1KL.png")
.setTimestamp()
.setFooter({
text: "Main title", iconURL: "https://i.imgur.com/2LUu1KL.png"
})
.setColor("00FF00");
// Send to channel with interaction
interaction.channel.send({ embeds: [embed] });
// Send to channel with message
message.channel.send({ embeds: [embed] });
xxxxxxxxxx
//Note: For discord.js version 14
const { EmbedBuilder } = require('discord.js');
const exampleEmbed = new EmbedBuilder()
.setColor(0x0099FF)
.setTitle('Some title')
.setURL('https://discord.js.org/')
.setAuthor({ name: 'Some name', iconURL: 'https://i.imgur.com/AfFp7pu.png', url: 'https://discord.js.org' })
.setDescription('Some description here')
.setThumbnail('https://i.imgur.com/AfFp7pu.png')
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Inline field title', value: 'Some value here', inline: true },
{ name: 'Inline field title', value: 'Some value here', inline: true },
)
.addFields({ name: 'Inline field title', value: 'Some value here', inline: true })
.setImage('https://i.imgur.com/AfFp7pu.png')
.setTimestamp()
.setFooter({ text: 'Some footer text here', iconURL: 'https://i.imgur.com/AfFp7pu.png' });
channel.send({ embeds: [exampleEmbed] });
xxxxxxxxxx
const embed = new Discord.RichEmbed() //Ver 11.5.1 of Discord.js
.setTitle("This is a title")
.setTitle("http://tryitands.ee")
.setDescription("This is a description")
.setTimestamp()
.setFooter("This is a footer")
.setAuthor("This is the author's name", //and this its profile pic)
.addField("This is a field", "this is its description")
.setImage("https://cdn.discordapp.com/avatars/449250687868469258/1709ab4f567c56eaa731518ff621747c.png?size=2048")
.setThumbnail("https://cdn.discordapp.com/avatars/449250687868469258/1709ab4f567c56eaa731518ff621747c.png?size=2048")
<message>.<channel>.send(embed)
xxxxxxxxxx
// Required Discord.js library
const Discord = require('discord.js');
// Creating a new embed object
const embed = new Discord.MessageEmbed()
.setColor('#0099ff') // Set the color of the embed
.setTitle('Embed Title') // Set the title of the embed
.setDescription('Embed Description') // Set the description of the embed
.addField('Field Name', 'Field Value') // Add a field to the embed
.setTimestamp(); // Add a timestamp to the embed
// Send the embed to a specific channel
const channel = client.channels.cache.get('CHANNEL_ID'); // Replace 'CHANNEL_ID' with the ID of the desired channel
channel.send(embed);