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
ProtectedReadonly
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 of this component.
NameTypeOptionalDescription
idnumberNoThe id to use
Inherited from ComponentBuilder
toJSON(validationOverride?):APITextDisplayComponent
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
NameTypeOptionalDescription
validationOverridebooleanYesForce validation to run/not run regardless of your global preference