Skip to main content

Class: MessagePrompterReactionStrategy

Defined in: projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterReactionStrategy.ts:7

Extends​

Implements​

  • MessagePrompterReactionStrategy

Constructors​

Constructor​

new MessagePrompterReactionStrategy(message: string | MessagePayload | MessageCreateOptions, options: IMessagePrompterReactionStrategyOptions): MessagePrompterReactionStrategy

Defined in: projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterReactionStrategy.ts:18

Constructor for the MessagePrompterReactionStrategy class

Parameters​

ParameterTypeDescription
messagestring | MessagePayload | MessageCreateOptionsThe message instance for this MessagePrompter
optionsIMessagePrompterReactionStrategyOptionsOverrideable options if needed.

Returns​

MessagePrompterReactionStrategy

Overrides​

MessagePrompterBaseStrategy.constructor

Properties​

appliedMessage​

appliedMessage: null | Message<boolean> = null

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

The message that has been sent in MessagePrompter.run

Implementation of​

MessagePrompterReactionStrategy.appliedMessage

Inherited from​

MessagePrompterBaseStrategy.appliedMessage


editMessage​

editMessage: undefined | Message<boolean>

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

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

Implementation of​

MessagePrompterReactionStrategy.editMessage

Inherited from​

MessagePrompterBaseStrategy.editMessage


explicitReturn​

explicitReturn: boolean

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

Whether to return an explicit object with data, or the strategies' default

Implementation of​

MessagePrompterReactionStrategy.explicitReturn

Inherited from​

MessagePrompterBaseStrategy.explicitReturn


message​

message: string | MessagePayload | MessageCreateOptions

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

The message that will be sent in MessagePrompter.run

Implementation of​

MessagePrompterReactionStrategy.message

Inherited from​

MessagePrompterBaseStrategy.message


reactions​

reactions: EmojiIdentifierResolvable[]

Defined in: projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterReactionStrategy.ts:11

The emojis used

Implementation of​

MessagePrompterReactionStrategy.reactions


timeout​

timeout: number

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

The timeout that was used in the collector

Implementation of​

MessagePrompterReactionStrategy.timeout

Inherited from​

MessagePrompterBaseStrategy.timeout


type​

type: string

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

The type of strategy that was used

Implementation of​

MessagePrompterReactionStrategy.type

Inherited from​

MessagePrompterBaseStrategy.type


defaultStrategyOptions​

static defaultStrategyOptions: IMessagePrompterStrategyOptions

Defined in: projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:129

The default strategy options

Inherited from​

MessagePrompterBaseStrategy.defaultStrategyOptions

Methods​

collectReactions()​

protected collectReactions(channel: MessagePrompterChannelTypes, authorOrFilter: User | CollectorFilter<[MessageReaction, User]>, reactions: string[] | EmojiIdentifierResolvable[]): Promise<IMessagePrompterExplicitReturnBase>

Defined in: projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:55

Parameters​

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

Returns​

Promise<IMessagePrompterExplicitReturnBase>

Implementation of​

MessagePrompterBaseStrategy.collectReactions

Inherited from​

MessagePrompterBaseStrategy.collectReactions


createReactionPromptFilter()​

protected createReactionPromptFilter(reactions: string[] | EmojiIdentifierResolvable[], authorOrFilter: User | CollectorFilter<[MessageReaction, User]>): CollectorOptions<[MessageReaction, User]>

Defined in: projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts:114

Creates a filter for the collector to filter on

Parameters​

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

Returns​

CollectorOptions<[MessageReaction, User]>

The filter for awaitReactions function

Implementation of​

MessagePrompterBaseStrategy.createReactionPromptFilter

Inherited from​

MessagePrompterBaseStrategy.createReactionPromptFilter


run()​

run(channel: MessagePrompterChannelTypes, authorOrFilter: User | CollectorFilter<[MessageReaction, User]>): Promise<EmojiResolvable | IMessagePrompterExplicitReturnBase>

Defined in: projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterReactionStrategy.ts:31

This executes the MessagePrompterReactionStrategy and sends the message. The handler will wait for one (1) reaction.

Parameters​

ParameterTypeDescription
channelMessagePrompterChannelTypesThe channel to use.
authorOrFilterUser | CollectorFilter<[MessageReaction, User]>An author object to validate or a CollectorFilter predicate callback.

Returns​

Promise<EmojiResolvable | IMessagePrompterExplicitReturnBase>

A promise that resolves to the reaction object.

Implementation of​

MessagePrompterReactionStrategy.run

Overrides​

MessagePrompterBaseStrategy.run