-
Notifications
You must be signed in to change notification settings - Fork 3
Components
extends ComponentsContainer
Represents a set of Component objects, offering an interface to control, modify, and retrieve Message Components easily. This is the entry point of this library and what this whole thing is about, that is, the builder.
Parameter | Type | Optional |
---|---|---|
data | Components-Resolvable | ✔ |
Name | Type | Description |
---|---|---|
buttons | ArrayIterable | A cache of all constructed Button objects in this instance. |
selectMenus | ArrayIterable | A cache of all constructed SelectMenu objects in this instance. |
Methods Inherited From ComponentsContainer
Returns a table of the raw components data the Discord API expects. User should never need to use this method. You are likely doing something wrong if you are using it directly.
Returns: table
Removes all components attached to this instance and reset its cache.
Returns self.
Returns: Components
Parameter | Type | Optional |
---|---|---|
data | Button-Resolvable/Custom-ID-Resolvable | |
actionRow | number | ✔ |
Constructs a new Button object with the initial provided data; if data
is a string it is treated
as if it were the id
field. actionRow
is an optional number of which Action Row this Button should go into.
Returns self.
This method only operates on data in memory.
Returns: Components
Parameter | Type |
---|---|
id | string |
Removes a previously constructed Button object with the custom_id of id
.
Returns self and the removed Button.
This method only operates on data in memory.
Returns: Components, Button
Parameter | Type |
---|---|
id | string |
Removes a previously constructed SelectMenu object with the custom_id of id
.
Returns self and the removed SelectMenu object.
This method only operates on data in memory.
Returns: Components, SelectMenu
Parameter | Type |
---|---|
data | SelectMenu-Resolvable/Custom-ID-Resolvable |
Constructs a new SelectMenu object with the initial provided data; if data
is a string
it is treated as if it were the id
field.
Returns self.
This method only operates on data in memory.
Returns: Components