ReactionUserManager
ReactionUserManager ⇐ Base
Section titled “ReactionUserManager ⇐ Base”A class representing a manager for reaction users.
Kind: global class
Extends: Base
- ReactionUserManager ⇐
Base- new ReactionUserManager(reaction, channelId, messageId, emoji, client)
- instance
- .cache ⇒
- ._add(users, [options]) ⇒
User|null - .fetch(options) ⇒
Promise.<Map.<string, ReactionUser>> - .remove([user]) ⇒
Promise.<Reaction>
- static
- .transformOptions(o) ⇒
Object
- .transformOptions(o) ⇒
new ReactionUserManager(reaction, channelId, messageId, emoji, client)
Section titled “new ReactionUserManager(reaction, channelId, messageId, emoji, client)”Constructs a ReactionCollector instance.
| Param | Type | Description |
|---|---|---|
| reaction | Reaction | The reaction object. |
| channelId | string | The ID of the channel where the reaction occurred. |
| messageId | string | The ID of the message where the reaction occurred. |
| emoji | Emoji | The emoji that was reacted with. |
| client | Client | The client instance. |
reactionUserManager.cache ⇒
Section titled “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
Section titled “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.
| Param | Type | Default | Description |
|---|---|---|---|
| users | User | string | The user object or user ID to add. | |
| [options] | Object | Additional options for adding the user. | |
| [options.cache] | boolean | true | Whether to cache the user object. |
| [options.force] | boolean | false | Whether to force fetching the user even if it is already cached. |
reactionUserManager.fetch(options) ⇒ Promise.<Map.<string, ReactionUser>>
Section titled “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.
| Param | Type | Default | Description |
|---|---|---|---|
| options | Object | The options for the fetch request. | |
| [options.cache] | boolean | true | Whether to cache the fetched data. |
| [options.force] | boolean | false | Whether to force the fetch request even if the data is already cached. |
reactionUserManager.remove([user]) ⇒ Promise.<Reaction>
Section titled “reactionUserManager.remove([user]) ⇒ Promise.<Reaction>”Removes a reaction from a message.
Kind: instance method of ReactionUserManager
Returns: Promise.<Reaction> - The removed reaction.
Throws:
RangeErrorIf no user is found.
| Param | Type | Default | Description |
|---|---|---|---|
| [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
Section titled “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.
| Param | Type | Description |
|---|---|---|
| o | Object | The options object. |