Class: MessagePrompterNumberStrategy
Extends
Implements
Constructors
Constructor
new MessagePrompterNumberStrategy(
message:string|MessagePayload|MessageCreateOptions,options:IMessagePrompterNumberStrategyOptions):MessagePrompterNumberStrategy
Constructor for the MessagePrompterBaseStrategy class
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | MessagePayload | MessageCreateOptions | The message instance for this MessagePrompter |
options | IMessagePrompterNumberStrategyOptions | Overrideable options if needed. |
Returns
MessagePrompterNumberStrategy
Overrides
MessagePrompterBaseStrategy.constructor
Properties
appliedMessage
appliedMessage:
null|Message<boolean> =null
The message that has been sent in MessagePrompter.run
Inherited from
MessagePrompterBaseStrategy.appliedMessage
editMessage
editMessage:
undefined|Message<boolean>
The message the bot will edit to send its prompt in MessagePrompter.run
Implementation of
IMessagePrompterNumberStrategyOptions.editMessage
Inherited from
MessagePrompterBaseStrategy.editMessage
end
end:
number
The available number emojis
Implementation of
IMessagePrompterNumberStrategyOptions.end
explicitReturn
explicitReturn:
boolean
Whether to return an explicit object with data, or the strategies' default
Implementation of
IMessagePrompterNumberStrategyOptions.explicitReturn
Inherited from
MessagePrompterBaseStrategy.explicitReturn
message
message:
string|MessagePayload|MessageCreateOptions
The message that will be sent in MessagePrompter.run
Inherited from
MessagePrompterBaseStrategy.message
numberEmojis
numberEmojis:
EmojiIdentifierResolvable[]
The available number emojis
Implementation of
IMessagePrompterNumberStrategyOptions.numberEmojis
start
start:
number
The available number emojis
Implementation of
IMessagePrompterNumberStrategyOptions.start
timeout
timeout:
number
The timeout that was used in the collector
Implementation of
IMessagePrompterNumberStrategyOptions.timeout
Inherited from
MessagePrompterBaseStrategy.timeout
type
type:
string
The type of strategy that was used
Inherited from
MessagePrompterBaseStrategy.type
defaultStrategyOptions
staticdefaultStrategyOptions:IMessagePrompterStrategyOptions
The default strategy options
Inherited from
MessagePrompterBaseStrategy.defaultStrategyOptions
numberEmojis
staticnumberEmojis:string[]
The default available number emojis
Methods
collectReactions()
protectedcollectReactions(channel:MessagePrompterChannelTypes,authorOrFilter:User|CollectorFilter<[MessageReaction,User]>,reactions:string[] |EmojiIdentifierResolvable[]):Promise<IMessagePrompterExplicitReturnBase>
Parameters
| Parameter | Type |
|---|---|
channel | MessagePrompterChannelTypes |
authorOrFilter | User | CollectorFilter<[MessageReaction, User]> |
reactions | string[] | EmojiIdentifierResolvable[] |
Returns
Promise<IMessagePrompterExplicitReturnBase>
Inherited from
MessagePrompterBaseStrategy.collectReactions
createReactionPromptFilter()
protectedcreateReactionPromptFilter(reactions:string[] |EmojiIdentifierResolvable[],authorOrFilter:User|CollectorFilter<[MessageReaction,User]>):CollectorOptions<[MessageReaction,User]>
Creates a filter for the collector to filter on
Parameters
| Parameter | Type |
|---|---|
reactions | string[] | EmojiIdentifierResolvable[] |
authorOrFilter | User | CollectorFilter<[MessageReaction, User]> |
Returns
CollectorOptions<[MessageReaction, User]>
The filter for awaitReactions function
Inherited from
MessagePrompterBaseStrategy.createReactionPromptFilter
run()
run(
channel:MessagePrompterChannelTypes,authorOrFilter:User|CollectorFilter<[MessageReaction,User]>):Promise<number|IMessagePrompterExplicitNumberReturn>
This executes the MessagePrompter and sends the message if IMessagePrompterOptions.type equals number. The handler will wait for one (1) reaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
channel | MessagePrompterChannelTypes | The channel to use. |
authorOrFilter | User | CollectorFilter<[MessageReaction, User]> | An author object to validate or a CollectorFilter predicate callback. |
Returns
Promise<number | IMessagePrompterExplicitNumberReturn>
A promise that resolves to the selected number within the range.