Skip to main content

Class: MessagePrompterNumberStrategy

Extends

Implements

Constructors

new MessagePrompterNumberStrategy()

new MessagePrompterNumberStrategy(message: string | MessagePayload | MessageCreateOptions, options: IMessagePrompterNumberStrategyOptions): MessagePrompterNumberStrategy

Constructor for the MessagePrompterBaseStrategy class

Parameters

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

Returns

MessagePrompterNumberStrategy

Overrides

MessagePrompterBaseStrategy.constructor

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterNumberStrategy.ts:26

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


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

Defined in

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


end

end: number

The available number emojis

Implementation of

IMessagePrompterNumberStrategyOptions.end

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterNumberStrategy.ts:19


explicitReturn

explicitReturn: boolean

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

Implementation of

IMessagePrompterNumberStrategyOptions.explicitReturn

Inherited from

MessagePrompterBaseStrategy.explicitReturn

Defined in

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


message

message: string | MessagePayload | MessageCreateOptions

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


numberEmojis

numberEmojis: EmojiIdentifierResolvable[]

The available number emojis

Implementation of

IMessagePrompterNumberStrategyOptions.numberEmojis

Defined in

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


start

start: number

The available number emojis

Implementation of

IMessagePrompterNumberStrategyOptions.start

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterNumberStrategy.ts:15


timeout

timeout: number

The timeout that was used in the collector

Implementation of

IMessagePrompterNumberStrategyOptions.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


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:129


numberEmojis

static numberEmojis: string[]

The default available number emojis

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterNumberStrategy.ts:63

Methods

collectReactions()

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

Parameters

ParameterType
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:55


createReactionPromptFilter()

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

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

Inherited from

MessagePrompterBaseStrategy.createReactionPromptFilter

Defined in

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


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

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

Overrides

MessagePrompterBaseStrategy.run

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/strategies/MessagePrompterNumberStrategy.ts:41