Skip to main content

Class: MessagePrompterConfirmStrategy

@sapphire/discord.js-utilities.MessagePrompterConfirmStrategy

Hierarchy

Implements

Constructors

constructor

โ€ข new MessagePrompterConfirmStrategy(message, options?)

Constructor for the MessagePrompterBaseStrategy class

Parameters

NameTypeDescription
messagestring | MessageOptions | MessagePayloadThe message to be sent MessagePrompter
options?IMessagePrompterConfirmStrategyOptionsOverrideable options if needed.

Overrides

MessagePrompterBaseStrategy.constructor

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts:23

Properties

appliedMessage

โ€ข appliedMessage: null | Message<boolean> = null

The message that has been sent in MessagePrompter.run

Inherited from

MessagePrompterBaseStrategy.appliedMessage

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:27


cancelEmoji

โ€ข cancelEmoji: EmojiResolvable

The cancel emoji used

Implementation of

IMessagePrompterConfirmStrategyOptions.cancelEmoji

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts:16


confirmEmoji

โ€ข confirmEmoji: EmojiResolvable

The confirm emoji used

Implementation of

IMessagePrompterConfirmStrategyOptions.confirmEmoji

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts:11


editMessage

โ€ข editMessage: undefined | Message<boolean>

The message the bot will edit to send its prompt in MessagePrompter.run

Implementation of

IMessagePrompterConfirmStrategyOptions.editMessage

Inherited from

MessagePrompterBaseStrategy.editMessage

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:37


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

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:22


message

โ€ข message: string | MessageOptions | MessagePayload

The message that will be sent in MessagePrompter.run

Inherited from

MessagePrompterBaseStrategy.message

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:32


timeout

โ€ข timeout: number

The timeout that was used in the collector

Implementation of

IMessagePrompterConfirmStrategyOptions.timeout

Inherited from

MessagePrompterBaseStrategy.timeout

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:17


type

โ€ข type: string

The type of strategy that was used

Inherited from

MessagePrompterBaseStrategy.type

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:12


cancelEmoji

โ–ช Static cancelEmoji: EmojiResolvable = '๐Ÿ‡ณ'

The default cancel emoji used for MessagePrompterConfirmStrategy

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts:57


confirmEmoji

โ–ช Static confirmEmoji: EmojiResolvable = '๐Ÿ‡พ'

The default confirm emoji used for MessagePrompterConfirmStrategy

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts:52


defaultStrategyOptions

โ–ช Static defaultStrategyOptions: IMessagePrompterStrategyOptions

The default strategy options

Inherited from

MessagePrompterBaseStrategy.defaultStrategyOptions

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:128

Methods

collectReactions

โ–ธ Protected collectReactions(channel, authorOrFilter, reactions): Promise<IMessagePrompterExplicitReturnBase>

Parameters

NameType
channelMessagePrompterChannelTypes
authorOrFilterUser | CollectorFilter<[MessageReaction, User]>
reactionsstring[] | EmojiIdentifierResolvable[]

Returns

Promise<IMessagePrompterExplicitReturnBase>

Inherited from

MessagePrompterBaseStrategy.collectReactions

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:54


createReactionPromptFilter

โ–ธ Protected createReactionPromptFilter(reactions, authorOrFilter): CollectorOptions<[MessageReaction, User]>

Creates a filter for the collector to filter on

Parameters

NameType
reactionsstring[] | EmojiIdentifierResolvable[]
authorOrFilterUser | CollectorFilter<[MessageReaction, User]>

Returns

CollectorOptions<[MessageReaction, User]>

The filter for awaitReactions function

Inherited from

MessagePrompterBaseStrategy.createReactionPromptFilter

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:113


run

โ–ธ run(channel, authorOrFilter): Promise<boolean | IMessagePrompterExplicitConfirmReturn>

This executes the MessagePrompter and sends the message if {@link IMessagePrompterOptions.type} equals confirm. The handler will wait for one (1) reaction.

Parameters

NameTypeDescription
channelMessagePrompterChannelTypesThe channel to use.
authorOrFilterUser | 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

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts:37