ReactionHandler
Vocality Documentation › Globals › ReactionHandler
Hierarchy
- ReactionHandler
Index
Constructors
Properties
Methods
Constructors
constructor
+ new ReactionHandler(): ReactionHandler
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:6
Returns: ReactionHandler
Properties
Private
pageChanges
• pageChanges: number
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:6
Methods
addPagination
▸ addPagination(message
: Message): Promise‹void›
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:23
Adds pagination arrows to the message
Parameters:
Name | Type |
---|---|
message | Message |
Returns: Promise‹void›
addReaction
▸ addReaction(message
: Message, emojiCode
: string): Promise‹void›
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:16
Helper function to add a reaction to the given message Codes for discord emojis can be found the root config file
Parameters:
Name | Type |
---|---|
message | Message |
emojiCode | string |
Returns: Promise‹void›
Private
getPaginationIndex
▸ getPaginationIndex(listLength
: number): number
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:113
Returns the zero based list index from the current pageChange.
Parameters:
Name | Type |
---|---|
listLength | number |
Returns: number
onReactionAll
▸ onReactionAll(message
: Message, duration
: number | undefined, callback
: function, additionalData?
: any): void
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:32
Registers a generic reaction collector to the message Invokes the callback with every collected reaction
Parameters:
▪ message: Message
▪ duration: number | undefined
▪ callback: function
▸ (reaction
: MessageReaction, additionalData?
: any): void
Parameters:
Name | Type |
---|---|
reaction | MessageReaction |
additionalData? | any |
▪Optional
additionalData: any
Returns: void
onReactionFiltered
▸ onReactionFiltered(message
: Message, duration
: number | undefined, filter
: function, callback
: Function, additionalData?
: any): void
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:83
Registers a reaction collector to the message with the given filter
Parameters:
▪ message: Message
▪ duration: number | undefined
▪ filter: function
▸ (reaction
: MessageReaction, user
: User, additionalData?
: any): boolean
Parameters:
Name | Type |
---|---|
reaction | MessageReaction |
user | User |
additionalData? | any |
▪ callback: Function
▪Optional
additionalData: any
Returns: void
onReactionPagination
▸ onReactionPagination(message
: Message, duration
: number | undefined, listLength
: number, callback
: function): void
Defined in packages/vocality-core/src/utils/ReactionHandler.ts:52
Registers a reaction collector to the message with a pagination specific filter Invokes the callback on every reaction that passes the pagination filter.
Parameters:
▪ message: Message
▪ duration: number | undefined
▪ listLength: number
▪ callback: function
▸ (reaction
: MessageReaction, index
: number): void
Parameters:
Name | Type |
---|---|
reaction | MessageReaction |
index | number |
Returns: void