Skip to main content

Class: abstract MessagePrompterBaseStrategy

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

Extended by

Constructors

new MessagePrompterBaseStrategy()

new MessagePrompterBaseStrategy(type: string, message: string | MessagePayload | MessageCreateOptions, options?: IMessagePrompterStrategyOptions): MessagePrompterBaseStrategy

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

Constructor for the MessagePrompterBaseStrategy class

Parameters

ParameterTypeDescription
typestringThe type of message prompter strategy
messagestring | MessagePayload | MessageCreateOptionsThe message that this prompt is for
options?IMessagePrompterStrategyOptionsOverrideable options if needed.

Returns

MessagePrompterBaseStrategy

Properties

appliedMessage

appliedMessage: null | Message = 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


editMessage

editMessage: undefined | Message

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


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


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


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


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


defaultStrategyOptions

static defaultStrategyOptions: IMessagePrompterStrategyOptions

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

The default strategy options

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>


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


run()

abstract run(channel: MessagePrompterChannelTypes, authorOrFilter: User | CollectorFilter<unknown[]>): unknown

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

Parameters

ParameterType
channelMessagePrompterChannelTypes
authorOrFilterUser | CollectorFilter<unknown[]>

Returns

unknown