Skip to content

ReactionUserManager

ReactionUserManager ⇐ Base

A class representing a manager for reaction users.

Kind: global class
Extends: Base

new ReactionUserManager(reaction, channelId, messageId, emoji, client)

Constructs a ReactionCollector instance.

ParamTypeDescription
reactionReactionThe reaction object.
channelIdstringThe ID of the channel where the reaction occurred.
messageIdstringThe ID of the message where the reaction occurred.
emojiEmojiThe emoji that was reacted with.
clientClientThe client instance.

reactionUserManager.cache ⇒

Getter method for the cache property.

Kind: instance property of ReactionUserManager
Returns: The Collection object representing the cache.

reactionUserManager._add(users, [options]) ⇒ User | null

Adds a user to the collection of users.

Kind: instance method of ReactionUserManager
Returns: User | null - The added user object or null if no user is provided.

ParamTypeDefaultDescription
usersUser | stringThe user object or user ID to add.
[options]ObjectAdditional options for adding the user.
[options.cache]booleantrueWhether to cache the user object.
[options.force]booleanfalseWhether to force fetching the user even if it is already cached.

reactionUserManager.fetch(options) ⇒ Promise.<Map.<string, ReactionUser>>

Fetches reaction users for a specific message and emoji.

Kind: instance method of ReactionUserManager
Returns: Promise.<Map.<string, ReactionUser>> - - A promise that resolves to a map of reaction users, where the keys are user IDs and the values are ReactionUser objects.

ParamTypeDefaultDescription
optionsObjectThe options for the fetch request.
[options.cache]booleantrueWhether to cache the fetched data.
[options.force]booleanfalseWhether to force the fetch request even if the data is already cached.

reactionUserManager.remove([user]) ⇒ Promise.<Reaction>

Removes a reaction from a message.

Kind: instance method of ReactionUserManager
Returns: Promise.<Reaction> - The removed reaction.
Throws:

  • RangeError If no user is found.
ParamTypeDefaultDescription
[user]string | User”this.client.user.id”The user ID or User object of the user whose reaction should be removed.

ReactionUserManager.transformOptions(o) ⇒ Object

Transforms the options object by extracting the “after” and “limit” properties.

Kind: static method of ReactionUserManager
Returns: Object - - The transformed options object.

ParamTypeDescription
oObjectThe options object.