Discord Additions - Embed Builder
Some helpful additions to make creating embeds easier.
Versions 1.0.2
and beyond have been changed to be compatible with Oceanic instead of Eris. If you're using this module with eris, do not update.
Get started by using our main class, the EmbedBuilder
.
import EmbedBuilder from "@discord-additions/embed-builder";
const embed = new EmbedBuilder();
embed.setAuthor("Hello", "https://i.furry.cool/DonPeek.png", "https://furry.cool");
console.log(embed.getAuthor());
embed.removeAuthor();
embed.setColor(0xFFA500);
embed.setDescription("hi this is some description content");
console.log(embed.getDescription());
embed.setDescription("separate parameters will be", "joined by newlines");
console.log(embed.getDescription());
embed.setDescription(["arrays are also", "accepted"], ["these will also be", "joined by newlines"]);
console.log(embed.getDescription());
embed.addField("field name", "field value");
embed.addField("field name", "field value", true);
embed.addField("field name", "field value", false);
embed.addBlankField();
embed.addBlankField(true);
embed.addBlankField(false);
embed.addFields([]);
embed.setFooter("hi", "https://i.furry.cool/DonMaidCrop.png");
embed.setImage("https://i.furry.cool/DonCoffee.png");
embed.setTimestamp("now");
embed.setTitle("some title stuff");
embed.setURL("https://furry.cool");
const json = embed.toJSON();
const jsonArray = embed.toJSON(true);
const load1 = EmbedBuilder.loadFromJSON({ title: "embed #1" });
const load2 = EmbedBuilder.loadFromJSON([ { title: "embed #1" }, { title: "embed #2" } ]);
const load1FromArray = EmbedBuilder.loadJSON([ { title: "embed #1" } ], true);
Install
npm i @discord-additions/embed-builder