ListPrompt

ListPrompt

Holds different list prompts.

Constructor

# new ListPrompt()

Methods

# (async, static) multiListChooser(promptInfo, list, amount) → {Promise.<Array>}

Prompts the user with a list of options, the user will select options by writing down the option's index.
Parameters:
Name Type Description
promptInfo PromptInfo
list Array the items in this list must have a valid toString() function
amount Number
Throws:
  • if the user takes longer than the given time to react
    Type
    TimeOutError
  • if the user cancels the prompt.
    Type
    CancelError
Returns:
- list of items the user choose
Type
Promise.<Array>

# (async, static) multiReactionPicker(promptInfo, options, amount) → {Promise.<Array.<PickerOption>>}

Prompts the user with a list of options. The user can react to the message to select options. This prompt works best with a low number of options (less than 5)!
Parameters:
Name Type Description
promptInfo PromptInfo cancelable is not used, users can't cancel this prompt!
options Array.<PickerOption>
amount Number
Throws:
if the user takes longer than the given time to choose the options.
Type
TimeOutError
Returns:
Type
Promise.<Array.<PickerOption>>

# (async, static) singleListChooser(promptInfo, list) → {*}

Prompts the user with a list of options, the user will select one option by writing down the chosen option index.
Parameters:
Name Type Description
promptInfo PromptInfo
list Array
Throws:
  • if the user takes longer than the given time to react
    Type
    TimeOutError
  • if the user cancels the prompt.
    Type
    CancelError
Returns:
- the item the user chooses
Type
*

# (async, static) singleReactionPicker(promptInfo, options) → {Promise.<PickerOption>}

Prompts the user with a lit of options. The user can react to the message to select an option. This prompt works best with a low number of options (less than 5)!
Parameters:
Name Type Description
promptInfo PromptInfo cancelable is not used, users can't cancel this prompt!
options Array.<PickerOption>
Throws:
if the user takes longer than the given time to choose the options.
Type
TimeOutError
Returns:
Type
Promise.<PickerOption>