-
Notifications
You must be signed in to change notification settings - Fork 0
Embeds
Embeds function similarly to how they do in Discord.JS except with a few adjustments to make things generally easier
For more info on embeds and how they're formatted check out this
Embeds are classes so they are created like this:
let embed = new wc.Embed({/* stuff */});
Now we'll go over the new additions for embeds
wc has built in colors that you can use for embeds
If you want a full list of the colors you can look here
For this example let's say we want to make the embed color blurple
{
// it can be any of these
color: wc.colors.blurple
color: "#7289da"
color: 0x7289da
}
wc also has built in times that you can use for embeds
You can either just make the timestamp value "now" or "current" or alternatively you can use wc.time and they should function the same.
{
// it can be any of these
timestamp: "now"
timestamp: "current"
timestamp: wc.time.now.embed
timestamp: wc.time.set.embed(date)
}
If you want more info on how embeds function this is the code:
Embed = class {
constructor(obj) {
if (obj.color) { obj.color = obj.color.colorFormat(); }
if (obj.author) {
if (obj.author.icon) { obj.author.icon_url = obj.author.icon; }
else if (obj.author.iconURL) { obj.author.icon_url = obj.author.iconURL; }
}
if (typeof obj.thumbnail == "string") {
let thumbnail = obj.thumbnail;
obj.thumbnail = { url: thumbnail };
}
if (obj.fields) {
let fixFields = [];
obj.fields.forEach( (field) => {
fixFields.push(field);
if (field.newline) { fixFields.push({ name:"** **", value: "** **", inline: false}); }
});
obj.fields = fixFields;
}
if (typeof obj.image == "string") {
let image = obj.image;
obj.image = { url: image };
}
if (obj.timestamp) {
if (obj.timestamp.toLowerCase() == "current" || obj.timestamp.toLowerCase() == "now") obj.timestamp = new Date().toISOString();
}
if (obj.footer) {
if (typeof obj.footer == "string") {
let footer = obj.footer;
obj.footer = { text: footer };
}
if (obj.footer.name) { obj.footer.text = obj.footer.name; }
if (obj.footer.icon) { obj.footer.icon_url = obj.footer.icon; }
else if (obj.footer.iconURL) { obj.footer.icon_url = obj.footer.iconURL; }
}
return obj;
}
}
For a look at some examples check out the examples folder
If anything with the mod is updated you can look to the releases for info on it
For a look into the development check out the index.js file
This mod is not associated with the creators of Discord, Discord.JS, or Discord.PY this was created out of love for Discord bot development because I wanted to make things easier for people. I do not condone harassment of the original developers and or anyone else involved in the creation of them.
I am not responsible for anything made with this mod and be sure to follow Discord's terms of service and their community guildlines while developing.
Basics
wc.command()
wc.slashCommand()
wc.commandList
wc.slashCommandList
Basics
wc.event()
wc.eventList
wc.commandAction()
wc.buttonAction()
wc.selectionAction()
wc.rowAction()
wc.fetchMessage()
wc.fetchReply()
wc.fetchUser()
wc.fetchGuildUser()
wc.fetchChannel()
wc.fetchGuildChannel()
wc.fetchRole()
wc.fetchGuildRole()
wc.fetchGuild()
wc.parseEmoji()
wc.parseSticker()