Button
Represents a button.
Constructor
js
new Button(client, options);
Name | Type | Description | Default | Optional |
---|---|---|---|---|
client | ShewenyClient | The client. | None | No |
customId | Array<String | RegExp> | The list of butons ids | None | ✓ |
options | ButtonOptions | The options. | None | ✓ |
Properties
client
The framework client.
Return : ShewenyClient
cooldown
The cooldown of the button (in seconds).
customId
The custom id(s) of the button.
Return : Array<String | RegExp>
enabled
If this structure is enabled or not.
manager
The manager of this structure.
Return : ButtonsManager
path
The path of the file.
Return : String
Methods
before()
Executed before button(s) checks.
Parameters :
Name | Type | Description |
---|---|---|
interaction | ButtonInteraction | The interaction |
Return : Promise<any> | any
[abstract] execute()
The execution of button(s).
Parameters :
Name | Type | Description |
---|---|---|
interaction | ButtonInteraction | The interaction |
Return : Promise<any> | any
[async] register()
Register the button.
Return : Promise<Button> | Null
[async] reload()
Reload a button of bot.
Return : Promise<Button> | Null
unregister()
Unregister a button from the bot.
Return : Boolean