RestrictedPrompt

RestrictedPrompt

The RestrictedPrompt class allows users to add the restricted feature to any prompt. This is useful for when developers want the response not to be something, and would like the bot to re-prompt until we get a clean response.

Constructor

# new RestrictedPrompt()

Methods

# (async, static) single(promptFunction, promptInfo, unavailableList) → {Promise.<(TextChannel|Role|GuildMember)>}

Re-prompt the user until their response is not part of the unavailableList. Will add the unavailable options to the prompt.
Parameters:
Name Type Description
promptFunction ChannelPrompt.single | RolePrompt.single | MemberPrompt.single
promptInfo PromptInfo
unavailableList Array.<TextChannel> | Array.<Role> | Array.<GuildMember> list the response can not be
Throws:
  • Error if the list item type does not match the return item from the prompt function.
  • if the user does not respond within the given time.
    Type
    TimeOutError
  • if the user cancels the prompt.
    Type
    CancelError
Returns:
Type
Promise.<(TextChannel|Role|GuildMember)>