Embeds are a way to display rich content in Discord messages.
They allow you to include images, formatted text, fields, and other interactive elements
within a message.
Create a discord-luau bot implementation:
local DiscordLuau = require ( " DiscordLuau " )
local DiscordSettings = DiscordLuau .SettingsBuilder. new ( " <DISCORD_TOKEN> " )
local DiscordClient = DiscordLuau .DiscordClient. new ( DiscordSettings )
DiscordClient .eventManager. onMessage : connect ( function ( message )
if message .content == " !embed " then
DiscordClient .eventManager. onReady : connect ( function ()
print ( ` ππ {DiscordClient.discordUser.username} is online! ππ ` )
DiscordClient : connectAsync ()
Allow the bot to check messages:
Go to the Discord Developer Portal
Choose your bot application in the Applications
tab
Go to the Bot
tab and enable MESSAGE CONTENT INTENT
Create a Discord embed that we can respond with:
local responseEmbed = DiscordLuau .EmbedBuilder. new ()
: setTitle ( " Example Embed " )
: setDescription ( " This is an example of an embed created using DiscordLuau! " )
: addField ( " Field 1 " , " Value 1 " , true )
: addField ( " Field 2 " , " Value 2 " , true )
: setFooter ( " This is a footer " )
Reply to the message with the newly created embed:
local responseMessage = DiscordLuau .MessageBuilder. new ()
local responseEmbed = DiscordLuau .EmbedBuilder. new ()
: setTitle ( " Example Embed " )
: setDescription ( " This is an example of an embed created using DiscordLuau! " )
: addField ( " Field 1 " , " Value 1 " , true )
: addField ( " Field 2 " , " Value 2 " , true )
: setFooter ( " This is a footer " )
message : replyAsync ( responseMessage : addEmbed ( responseEmbed ))
See The Entire Code local DiscordLuau = require ( " DiscordLuau " )
local DiscordSettings = DiscordLuau .SettingsBuilder. new ( " <DISCORD_TOKEN> " )
local DiscordClient = DiscordLuau .DiscordClient. new ( DiscordSettings )
DiscordClient .eventManager. onMessage : connect ( function ( message )
if message .Content == " !embed " then
local responseMessage = DiscordLuau .MessageBuilder. new ()
local responseEmbed = DiscordLuau .EmbedBuilder. new ()
: setTitle ( " Example Embed " )
: setDescription ( " This is an example of an embed created using DiscordLuau! " )
: addField ( " Field 1 " , " Value 1 " , true )
: addField ( " Field 2 " , " Value 2 " , true )
: setFooter ( " This is a footer " )
message : replyAsync ( responseMessage : addEmbed ( responseEmbed ))
DiscordClient .eventManager. onReady : connect ( function ()
print ( ` ππ {DiscordClient.discordUser.username} is online! ππ ` )
DiscordClient : connectAsync ()
Thatβs all! For more details, refer to the relevant docs;