Methods
(async, static) menu(options, …argsopt) → {Controller}
Create a reaction menu. See example in https://github.com/IDjinn/Discord.js-Collector/blob/master/examples/reaction-collector/menu.js
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
Options to create a reaction menu.
|
|||||||||||||||||||||
args |
*
|
<optional> <repeatable> |
Arguments given when onReact or onMessage function was triggered. |
Returns:
- Type:
-
Controller
(async, static) paginator(options)
This method can be used to create easier react pagination, with multiple embeds pages.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
PaginatorOptions
|
|
Returns:
void
Example
const botMessage = await message.channel.send('Simple paginator...');
ReactionCollector.paginator({
botMessage,
user: message.author,
pages: [
new MessageEmbed({ description: 'First page content...' }),
new MessageEmbed({ description: 'Second page content...' })
]
});
(static) question(options, …argsopt)
This method can be used in multiples emoji choices.
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
CollectorOptions
|
|
||||||||||||||||||||||||||||||||||||
args |
*
|
<optional> <repeatable> |
All args given at trigger onReact() funcion. See example in https://github.com/IDjinn/Discord.js-Collector/tree/master/examples/reaction-collector/question.js |
Returns:
Discord.ReactionCollector
(async, static) yesNoQuestion(options) → {Promise.<boolean>}
See full example in https://github.com/IDjinn/Discord.js-Collector/blob/master/examples/reaction-collector/yesNoQuestion.js
This method can be used in async methods, returning only boolean value, more easier to use inside if tratament or two choices.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
AsyncCollectorOptions
|
|
Returns:
- Type:
-
Promise.<boolean>
Example
const botMessage = await message.channel.send('Simple yes/no question');
if (await ReactionCollector.yesNoQuestion({ user: message.author, botMessage }))
message.channel.send('You\'ve clicked in yes button!');
else
message.channel.send('You\'ve clicked in no button!');