Search...

ComponentBuilder

The base component builder that contains common symbols for all sorts of components.
export declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>> implements JSONEncodable<AnyAPIActionRowComponent> 
export declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>> implements JSONEncodable<AnyAPIActionRowComponent> 

Implements

JSONEncodable<AnyAPIActionRowComponent>

constructor(data)

Constructs a new kind of component.
NameTypeOptionalDescription
dataPartial<DataType>NoThe data to construct a component out of
Readonly

data

:

Partial<DataType>

The API data associated with this component.
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.