DiscordJS example of RichEmbed

Free lines JavaScript 1 revisions 1350 2 years ago 2 years ago
const Discord = require('discord.js');

const embed = new Discord.RichEmbed();
embed.setTitle('This is an example title');
embed.setColor('#4caf50');                                        // A Hex color
embed.setDescription('A description that supports `markdown`');
embed.setURL('https://codebottle.io/');                           // A URL to include
embed.setAuthor('OverCoder');                                     // Author of the object 

// Send the embed to `channel`

This is a basic example of creating and sending a rich embed on Discord using DiscordJS.

Here we are assuming channel is a TextChannel object. You might also want to see DiscordJS example bot.

You can view the full documentation of RichEmbeds here.