ReactionHandler

Vocality DocumentationGlobalsReactionHandler

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:

NameType
messageMessage

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:

NameType
messageMessage
emojiCodestring

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:

NameType
listLengthnumber

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:

NameType
reactionMessageReaction
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:

NameType
reactionMessageReaction
userUser
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:

NameType
reactionMessageReaction
indexnumber

Returns: void