-
Notifications
You must be signed in to change notification settings - Fork 3
Components
Represents a set of Component objects, offering an interface to control, modify, and retrieve 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. |
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
Returns a table value of what the raw value Discord would accept is like based on assumptions of the current components.
By design, user should never need to use this method.
This method only operates on data in memory.
Returns: table
Removes all components attached to this instance and reset its cache.
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