Skip to content
On this page

Button

Represents a button.

Constructor

js
new Button(client, options);
NameTypeDescriptionDefaultOptional
clientShewenyClientThe client.NoneNo
customIdArray<String | RegExp>The list of butons idsNone
optionsButtonOptionsThe options.None
Properties
Methods

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 :

NameTypeDescription
interactionButtonInteractionThe interaction

Return : Promise<any> | any

[abstract] execute()

The execution of button(s).

Parameters :

NameTypeDescription
interactionButtonInteractionThe 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