JaDL Embed
Simple and easy to use embed renderer
const embed = new Embed()
.title('Hello world!')
To get the raw API embed object you do embed.render()
Custom sendback
Which this embed, you can create sendbacks that allow you to use nested .send() methods
For example
const embed = new Embed((embed) => {
console.log(embed.render())
})
embed
.title('Hello!')
.send()
This is super useful for creating nested library functions e.g, how we do it in JADL is a .embed method that returns a new embed, and handles the .send() seamlessly to it's context
In TS
You can also create custom return types and paramater names like so:
const embed = new Embed<
Promise<APIMessage>,
[
reply?: boolean,
mention?: boolean
]
>((embed, options) => {
return API.sendMessage(embed.render())
})
embed
.title('Hello!')
.send(true, true)