Skip to content

Sending an embed

Furret edited this page Apr 16, 2023 · 2 revisions

Embeds

Sending embeds in hxdiscord is actually easy

First of all, you have to import the embed class

import hxdiscord.types.Embed;

Then, you have to make a Embed variable, then you can change the title, description, and basically everything. This is how it's done

var myEmbed:Embed = new Embed();
myEmbed.setTitle("A title!");
myEmbed.setDescription("A description, woah!");

Then, to send it you just have to pass the Embed variable that we created earlier to the reply function. Like this

m.reply({embeds: [myEmbed]}, true);

Note that "m" is a variable that's inside the function, it can be either a message or an interaction, do not set m if your variable is not m, use your variable

You can send multiple embeds, just, add another embed into the embeds array

Clone this wiki locally