Class: MessagePrompterMessageStrategy
Extends
Implements
Constructors
new MessagePrompterMessageStrategy()
new MessagePrompterMessageStrategy(
message:string|MessagePayload|MessageCreateOptions,options:IMessagePrompterStrategyOptions):MessagePrompterMessageStrategy
Constructor for the MessagePrompterBaseStrategy class
Parameters
| Parameter | Type | Description |
|---|---|---|
message | string | MessagePayload | MessageCreateOptions | The message instance for this MessagePrompter |
options | IMessagePrompterStrategyOptions | Overrideable options if needed. |
Returns
MessagePrompterMessageStrategy
Overrides
MessagePrompterBaseStrategy . constructor
Source
Properties
appliedMessage
appliedMessage:
null|Message<boolean> =null
The message that has been sent in MessagePrompter.run
Inherited from
MessagePrompterBaseStrategy . appliedMessage
Source
editMessage
editMessage:
undefined|Message<boolean>
The message the bot will edit to send its prompt in MessagePrompter.run
Implementation of
IMessagePrompterStrategyOptions . editMessage
Inherited from
MessagePrompterBaseStrategy . editMessage
Source
explicitReturn
explicitReturn:
boolean
Whether to return an explicit object with data, or the strategies' default
Implementation of
IMessagePrompterStrategyOptions . explicitReturn
Inherited from
MessagePrompterBaseStrategy . explicitReturn
Source
message
message:
string|MessagePayload|MessageCreateOptions
The message that will be sent in MessagePrompter.run
Inherited from
MessagePrompterBaseStrategy . message
Source
timeout
timeout:
number
The timeout that was used in the collector
Implementation of
IMessagePrompterStrategyOptions . timeout
Inherited from
MessagePrompterBaseStrategy . timeout
Source
type
type:
string
The type of strategy that was used
Inherited from
MessagePrompterBaseStrategy . type
Source
defaultStrategyOptions
staticdefaultStrategyOptions:IMessagePrompterStrategyOptions
The default strategy options
Inherited from
MessagePrompterBaseStrategy . defaultStrategyOptions
Source
Methods
collectReactions()
protectedcollectReactions(channel:MessagePrompterChannelTypes,authorOrFilter:User|CollectorFilter<[MessageReaction,User]>,reactions:string[] |EmojiIdentifierResolvable[]):Promise<IMessagePrompterExplicitReturnBase>
Parameters
| Parameter | Type |
|---|---|
channel | MessagePrompterChannelTypes |
authorOrFilter | User | CollectorFilter <[MessageReaction, User]> |
reactions | string[] | EmojiIdentifierResolvable[] |
Returns
Promise <IMessagePrompterExplicitReturnBase>
Inherited from
MessagePrompterBaseStrategy . collectReactions
Source
createMessagePromptFilter()
privatecreateMessagePromptFilter(authorOrFilter:User|CollectorFilter<[Message<boolean>]>):CollectorOptions<[Message<boolean>]>
Creates a filter for the collector to filter on
Parameters
| Parameter | Type |
|---|---|
authorOrFilter | User | CollectorFilter <[Message<boolean>]> |
Returns
CollectorOptions <[Message<boolean>]>
The filter for awaitMessages function
Source
createReactionPromptFilter()
protectedcreateReactionPromptFilter(reactions:string[] |EmojiIdentifierResolvable[],authorOrFilter:User|CollectorFilter<[MessageReaction,User]>):CollectorOptions<[MessageReaction,User]>
Creates a filter for the collector to filter on
Parameters
| Parameter | Type |
|---|---|
reactions | string[] | EmojiIdentifierResolvable[] |
authorOrFilter | User | CollectorFilter <[MessageReaction, User]> |
Returns
CollectorOptions <[MessageReaction, User]>
The filter for awaitReactions function
Inherited from
MessagePrompterBaseStrategy . createReactionPromptFilter
Source
run()
run(
channel:MessagePrompterChannelTypes,authorOrFilter:User|CollectorFilter<[Message<boolean>]>):Promise<Message<boolean> |IMessagePrompterExplicitMessageReturn>
This executes the MessagePrompter and sends the message if IMessagePrompterOptions.type equals message. The handler will wait for one (1) message.
Parameters
| Parameter | Type | Description |
|---|---|---|
channel | MessagePrompterChannelTypes | The channel to use. |
authorOrFilter | User | CollectorFilter <[Message<boolean>]> | An author object to validate or a CollectorFilter predicate callback. |
Returns
Promise <Message<boolean> | IMessagePrompterExplicitMessageReturn>
A promise that resolves to the message object received.
Overrides
MessagePrompterBaseStrategy . run