EmbedBuilder
It’s a class that creates a Discord embed.
Kind: global class
- EmbedBuilder
- new EmbedBuilder([data])
- instance
- static
new EmbedBuilder([data])
Section titled “new EmbedBuilder([data])”It takes in an object, and then assigns the values of the object to the class properties.
| Param | Description |
|---|---|
| [data] | The data to use for the embed. |
embedBuilder.setTitle(title) ⇒
Section titled “embedBuilder.setTitle(title) ⇒”It sets the title of the book and returns the book object.
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Type | Description |
|---|---|---|
| title | string | The title of the modal. |
embedBuilder.setDescription(description) ⇒
Section titled “embedBuilder.setDescription(description) ⇒”The function sets the description of the object and returns the object.
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Type | Description |
|---|---|---|
| description | string | The description of the field. |
embedBuilder.setURL(url) ⇒
Section titled “embedBuilder.setURL(url) ⇒”This function sets the url property of the object it is called on to the value of the argument passed in, and then returns the object it was called on.
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Type | Description |
|---|---|---|
| url | string | The URL to send the request to. |
embedBuilder.setTimestamp(timestamp) ⇒
Section titled “embedBuilder.setTimestamp(timestamp) ⇒”It takes a timestamp and converts it to an ISO string.
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Description |
|---|---|
| timestamp | The timestamp of the message. |
embedBuilder.setColor(color) ⇒
Section titled “embedBuilder.setColor(color) ⇒”This function sets the color of the object.
Kind: instance method of EmbedBuilder
Returns: The color of the object.
| Param | Description |
|---|---|
| color | The color of the line. |
embedBuilder.setFooter(footer) ⇒
Section titled “embedBuilder.setFooter(footer) ⇒”The setFooter function takes a footer parameter and sets the footer property of the object to the footer parameter. It then returns the object
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Description |
|---|---|
| footer | The footer text. |
embedBuilder.setImage(image) ⇒
Section titled “embedBuilder.setImage(image) ⇒”It sets the image property of the object to the image parameter if the image parameter is not null, otherwise it sets the image property to undefined
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Description |
|---|---|
| image | The image to display. |
embedBuilder.setThumbnail(thumbnail) ⇒
Section titled “embedBuilder.setThumbnail(thumbnail) ⇒”It sets the thumbnail property of the object to the thumbnail parameter if it exists, otherwise it sets it to undefined
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Description |
|---|---|
| thumbnail | The thumbnail of the embed. |
embedBuilder.setAuthor(author) ⇒
Section titled “embedBuilder.setAuthor(author) ⇒”The function sets the author of the book and returns the book object.
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Description |
|---|---|
| author | The author of the book. |
embedBuilder.addFields(…fields) ⇒
Section titled “embedBuilder.addFields(…fields) ⇒”It takes an array of objects, and pushes each object into another array
Kind: instance method of EmbedBuilder
Returns: The return value is the instance of the class.
| Param | Description | | --------- | ------------------------------ | ----------------- | | …fields | Array<EmbedBuilderField> | EmbedBuilderField |
embedBuilder.addField(nm, vl, il) ⇒
Section titled “embedBuilder.addField(nm, vl, il) ⇒”It adds a field to the embed
Kind: instance method of EmbedBuilder
Returns: The object itself.
| Param | Description |
|---|---|
| nm | The name of the field. |
| vl | The value of the field. |
| il | Inline |
embedBuilder.setFields(…fields) ⇒
Section titled “embedBuilder.setFields(…fields) ⇒”It takes an array of objects, and then maps over each object, and then returns the mapped array
Kind: instance method of EmbedBuilder
Returns: The fields are being returned.
| Param | Description | | --------- | ------------------------------ | ----------------- | | …fields | Array<EmbedBuilderField> | EmbedBuilderField |
embedBuilder.toJSON() ⇒
Section titled “embedBuilder.toJSON() ⇒”It returns an object with the properties of the embed
Kind: instance method of EmbedBuilder
Returns: The return value is an object with the properties of the embed.
EmbedBuilder.transformFields(fields) ⇒
Section titled “EmbedBuilder.transformFields(fields) ⇒”It takes an array of objects, and returns an array of objects with the same keys, but with the values transformed
Kind: static method of EmbedBuilder
Returns: The return value is an object with the properties name, value, and inline.
| Param | Description |
|---|---|
| fields | The fields to be added to the embed. |