Class: MessagePrompterConfirmStrategy
@sapphire/discord.js-utilities.MessagePrompterConfirmStrategy
Hierarchy
↳
MessagePrompterConfirmStrategy
Implements
Constructors
constructor
• new MessagePrompterConfirmStrategy(message
, options?
)
Constructor for the MessagePrompterBaseStrategy class
Parameters
Name | Type | Description |
---|---|---|
message | string | MessagePayload | MessageCreateOptions | The message to be sent MessagePrompter |
options? | IMessagePrompterConfirmStrategyOptions | Overrideable options if needed. |
Overrides
MessagePrompterBaseStrategy.constructor
Defined in
Properties
appliedMessage
• appliedMessage: null
| Message
<boolean
> = null
The message that has been sent in run
Inherited from
MessagePrompterBaseStrategy.appliedMessage
Defined in
cancelEmoji
• cancelEmoji: EmojiResolvable
The cancel emoji used
Implementation of
IMessagePrompterConfirmStrategyOptions.cancelEmoji
Defined in
confirmEmoji
• confirmEmoji: EmojiResolvable
The confirm emoji used
Implementation of
IMessagePrompterConfirmStrategyOptions.confirmEmoji
Defined in
editMessage
• editMessage: undefined
| Message
<boolean
>
The message the bot will edit to send its prompt in run
Implementation of
IMessagePrompterConfirmStrategyOptions.editMessage
Inherited from
MessagePrompterBaseStrategy.editMessage
Defined in
explicitReturn
• explicitReturn: boolean
Whether to return an explicit object with data, or the strategies' default
Implementation of
IMessagePrompterConfirmStrategyOptions.explicitReturn
Inherited from
MessagePrompterBaseStrategy.explicitReturn
Defined in
message
• message: string
| MessagePayload
| MessageCreateOptions
The message that will be sent in run
Inherited from
MessagePrompterBaseStrategy.message
Defined in
timeout
• timeout: number
The timeout that was used in the collector
Implementation of
IMessagePrompterConfirmStrategyOptions.timeout
Inherited from
MessagePrompterBaseStrategy.timeout
Defined in
type
• type: string
The type of strategy that was used
Inherited from
MessagePrompterBaseStrategy.type
Defined in
cancelEmoji
▪ Static
cancelEmoji: EmojiResolvable
= '🇳'
The default cancel emoji used for MessagePrompterConfirmStrategy
Defined in
confirmEmoji
▪ Static
confirmEmoji: EmojiResolvable
= '🇾'
The default confirm emoji used for MessagePrompterConfirmStrategy
Defined in
defaultStrategyOptions
▪ Static
defaultStrategyOptions: IMessagePrompterStrategyOptions
The default strategy options
Inherited from
MessagePrompterBaseStrategy.defaultStrategyOptions
Defined in
Methods
collectReactions
▸ Protected
collectReactions(channel
, authorOrFilter
, reactions
): Promise
<IMessagePrompterExplicitReturnBase
>
Parameters
Name | Type |
---|---|
channel | MessagePrompterChannelTypes |
authorOrFilter | User | CollectorFilter <[MessageReaction , User ]> |
reactions | string [] | EmojiIdentifierResolvable [] |
Returns
Promise
<IMessagePrompterExplicitReturnBase
>
Inherited from
MessagePrompterBaseStrategy.collectReactions
Defined in
createReactionPromptFilter
▸ Protected
createReactionPromptFilter(reactions
, authorOrFilter
): CollectorOptions
<[MessageReaction
, User
]>
Creates a filter for the collector to filter on
Parameters
Name | Type |
---|---|
reactions | string [] | EmojiIdentifierResolvable [] |
authorOrFilter | User | CollectorFilter <[MessageReaction , User ]> |
Returns
CollectorOptions
<[MessageReaction
, User
]>
The filter for awaitReactions function
Inherited from
MessagePrompterBaseStrategy.createReactionPromptFilter
Defined in
run
▸ run(channel
, authorOrFilter
): Promise
<boolean
| IMessagePrompterExplicitConfirmReturn
>
This executes the MessagePrompter and sends the message if IMessagePrompterOptions.type equals confirm. The handler will wait for one (1) reaction.
Parameters
Name | 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
<boolean
| IMessagePrompterExplicitConfirmReturn
>
A promise that resolves to a boolean denoting the value of the input (true
for yes, false
for no).
Overrides
MessagePrompterBaseStrategy.run