TextDisplayBuilder

export declare class TextDisplayBuilder extends ComponentBuilder<APITextDisplayComponent>
export declare class TextDisplayBuilder extends ComponentBuilder<APITextDisplayComponent>

No summary provided.

constructor(data?)
Creates a new text display from API data.
Example
Creating a text display from an API data object:
const textDisplay = new TextDisplayBuilder({
content: 'some text',
});
const textDisplay = new TextDisplayBuilder({
content: 'some text',
});
Example
Creating a text display using setters and API data:
const textDisplay = new TextDisplayBuilder({
content: 'old text',
})
.setContent('new text');
const textDisplay = new TextDisplayBuilder({
content: 'old text',
})
.setContent('new text');
NameTypeOptionalDescription
dataPartial<APITextDisplayComponent>YesThe API data to create this text display with
The API data associated with this component.
Inherited from ComponentBuilder
clearId():this
Clears the id of this component, defaulting to a default incremented id.
Inherited from ComponentBuilder
setContent(content):this
Sets the text of this text display.
NameTypeOptionalDescription
contentstringNoThe text to use
setId(id):this
Sets the id (not the custom id) for this component.
NameTypeOptionalDescription
idnumberNoThe id for this component
Inherited from ComponentBuilder
Serializes this builder to API-compatible JSON data.
Remarks
This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.