Skip to content
On this page

ButtonsManager

Create an handler for bot buttons. The buttons can be in as many subfolders as desired and there may be other files exporting something else.

Constructor

js
new ButtonsManager(client, options);
NameTypeDescriptionDefaultOptional
clientShewenyClientThe clientNoneNo
optionsButtonsManagerOptionsThe options of the managerNoneNo
Properties
Methods
Events

Properties

buttons

The collection of loaded buttons.

Return : Collection<Button>

client

The framework client.

Return : ShewenyClient

directory

The directory of buttons.

Return : String

Methods

loadAll()

Load all buttons in directory of buttons.

Return : Promise<Collection<Array<String>, Button>>

unloadAll()

Unload all buttons.

Return : void

Events

cooldownLimit

Emitted when user hit the cooldown limit.

Parameters :

NameTypeDescription
interactionButtonInteractionThe interaction
timeNumberThe time before run again