Methods
(static) .createInstance(client: Client) → void
Create the CompactModeHelper singleton instance
Note: This is called automatically by the Client. You do not need to create your own instance
Parameters:
Name | Type | Description |
---|---|---|
client |
|
YAMDBF Client instance |
(static) .registerButton(message: Message, emoji: string, action: function, lifespan?: number) → Promise<void>
Register a single-use reaction button on a Message that will execute the given action when clicked by the Message author.
Buttons remain clickable for the given lifespan (30 seconds by default), or until consumed via click by the Message author
If the Client doesn't have permissions to add reactions the given action function will be invoked immediately
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
message |
|
Message to register a button for |
||
emoji |
|
A unicode emoji, custom emoji ID, or a button
key from |
||
action |
|
Function to execute when the reaction button is clicked |
||
lifespan |
|
<optional> |
30000
|
Lifespan of the button in MS |