Skip to main content

Class: MessagePrompter<S>

discord.js-utilities/src.MessagePrompter

Type parameters

NameType
Sextends keyof StrategyReturns = "confirm"

Constructors

constructor

new MessagePrompter<S>(message, strategy?, strategyOptions?)

Type parameters

NameType
Sextends keyof StrategyReturns = "confirm"

Parameters

NameTypeDescription
messageMessagePrompterMessage | MessagePrompterBaseStrategy
strategy?S
strategyOptions?S extends keyof StrategyOptions ? StrategyOptions[S] : never

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/MessagePrompter.ts:110

Properties

strategy

strategy: MessagePrompterBaseStrategy

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/MessagePrompter.ts:102


defaultStrategy

Static defaultStrategy: keyof StrategyReturns = 'confirm'

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/MessagePrompter.ts:169


strategies

Static strategies: Map<keyof StrategyReturns, Ctor<[message: MessagePrompterMessage, options?: IMessagePrompterConfirmStrategyOptions] | [message: MessagePrompterMessage, options: IMessagePrompterNumberStrategyOptions] | [message: MessagePrompterMessage, options: IMessagePrompterReactionStrategyOptions] | [message: MessagePrompterMessage, options: IMessagePrompterStrategyOptions], MessagePrompterConfirmStrategy | MessagePrompterMessageStrategy | MessagePrompterNumberStrategy | MessagePrompterReactionStrategy>>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/MessagePrompter.ts:149

Methods

run

run<Filter>(channel, authorOrFilter): S extends keyof StrategyReturns ? Promise<StrategyReturns[S]> : never

Type parameters

NameType
Filterextends [Message<boolean>] | [MessageReaction, User]

Parameters

NameTypeDescription
channelMessagePrompterChannelTypes
authorOrFilterUser | CollectorFilter<Filter>

Returns

S extends keyof StrategyReturns ? Promise<StrategyReturns[S]> : never

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/MessagePrompter.ts:137