new MessageBuilder()
This is the class to initialize a new MessageBuilder.
Chaining of properties is supported so you can message.setTitle("abc").setDescription("blah")
- Source:
Methods
addField(title, value, inline)
This method adds a new field to the embed.
Parameters:
Name | Type | Description |
---|---|---|
title |
string | The title of the field. |
value |
string | The value of the field. |
inline |
bool | Should the field be an inline field |
- Source:
getJSON()
Return the data that would be sent to the webhook if it was executed.
- Source:
removeField(name)
Remove a field from an embed
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the field to remove |
- Source:
setAuthor(author, iconURL, url)
Set the author of the embed
Parameters:
Name | Type | Description |
---|---|---|
author |
string | Name of the author |
iconURL |
string | Optional: Icon URL of the author |
url |
string | Optional: Link to the author |
- Source:
setAvatar(avatarURL)
Add an avatar to the webhooks
Parameters:
Name | Type | Description |
---|---|---|
avatarURL |
string | The URL to the avatar. |
- Source:
setColor(color)
This method sets the color of the embed.
Parameters:
Name | Type | Description |
---|---|---|
color |
string | The hexadecimal color |
- Source:
setDescription(description)
Set the description of the embed
Parameters:
Name | Type | Description |
---|---|---|
description |
string | The description to use |
- Source:
setFooter(footer, footerIcon)
Set the footer of the embed
Parameters:
Name | Type | Description |
---|---|---|
footer |
string | The footer to use |
footerIcon |
string | The icon to display in the footer |
- Source:
setImage(imageURL)
This method adds an image to the embed.
Parameters:
Name | Type | Description |
---|---|---|
imageURL |
string | The URL to the image. |
- Source:
setName(username)
This method sets the username of the hook
Parameters:
Name | Type | Description |
---|---|---|
username |
string | The username to use |
- Source:
setText(text)
Set the text to be sent alongside the embed.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | The text. |
- Source:
setThumbnail(thumbnailURL)
This method adds a thumbnail to the embed.
Parameters:
Name | Type | Description |
---|---|---|
thumbnailURL |
string | The URL to the thumbnail. |
- Source:
setTime(timestamp)
Set timestamp, if no argument is passed, the current
time is used.
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
number | The timestamp to use. |
- Source:
setTitle(title)
Set the title of the embed
Parameters:
Name | Type | Description |
---|---|---|
title |
string | The title to use |
- Source:
setURL(url)
Set the URL for the Discord embed
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL to link to from the embed. |
- Source: