Constructor
# new StringPrompt()
Methods
# (async, static) multiRestricted(promptInfo, possibleResponses, amountopt) → {Promise.<Array.<String>>}
Prompts the user for one or more strings. The strings must be part of the possibleResponses.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
promptInfo |
PromptInfo | |||
possibleResponses |
Array.<String> | list of valid responses the user can respond with They must be single strings with no spaces. | ||
amount |
Number |
<optional> |
Infinity | the amount of responses to expect |
Throws:
-
-
if the user does not respond within the given time.
- Type
- TimeOutError
-
-
-
if the user cancels the prompt.
- Type
- CancelError
-
Returns:
- Type
- Promise.<Array.<String>>
# (async, static) restricted(promptInfo, possibleResponses) → {Promise.<String>}
Prompts a user for one of a list of possible responses. Will re-prompt if given something different.
The response is case sensitive!
Parameters:
Name | Type | Description |
---|---|---|
promptInfo |
PromptInfo | |
possibleResponses |
Array.<String> | list of responses to match the actual response or re-prompt They must be single strings with no spaces. |
Throws:
-
-
if the user does not respond within the given time.
- Type
- TimeOutError
-
-
-
if the user cancels the prompt.
- Type
- CancelError
-
Returns:
- Type
- Promise.<String>
# (async, static) single(promptInfo) → {Promise.<String>}
Prompts the user for a single string, can be as long as the user wants. Discord content will be toString()ed.
Parameters:
Name | Type | Description |
---|---|---|
promptInfo |
PromptInfo |
Throws:
-
-
if the user does not respond within the given time.
- Type
- TimeOutError
-
-
-
if the user cancels the prompt.
- Type
- CancelError
-
Returns:
- Type
- Promise.<String>