This commit is contained in:
Elysia
2024-01-10 18:30:39 +07:00
parent b3cf4b7710
commit 59f254966c
14 changed files with 637 additions and 937 deletions

View File

@@ -3,15 +3,15 @@
const { Collection } = require('@discordjs/collection');
const CachedManager = require('./CachedManager');
const { Error } = require('../errors');
const { lazy } = require('../util/Util');
const User = lazy(() => require('../structures/User'));
const User = require('../structures/User');
/**
* Manages API methods for users who reacted to a reaction and stores their cache.
* @extends {CachedManager}
*/
class ReactionUserManager extends CachedManager {
constructor(reaction, iterable) {
super(reaction.client, User(), iterable);
super(reaction.client, User, iterable);
/**
* The reaction that this manager belongs to
@@ -22,7 +22,7 @@ class ReactionUserManager extends CachedManager {
/**
* The cache of this manager
* @type {Collection<Snowflake, Discord.User>}
* @type {Collection<Snowflake, User>}
* @name ReactionUserManager#cache
*/
@@ -36,7 +36,7 @@ class ReactionUserManager extends CachedManager {
/**
* Fetches all the users that gave this reaction. Resolves with a collection of users, mapped by their ids.
* @param {FetchReactionUsersOptions} [options] Options for fetching the users
* @returns {Promise<Collection<Snowflake, Discord.User>>}
* @returns {Promise<Collection<Snowflake, User>>}
*/
async fetch({ limit = 100, after } = {}) {
const message = this.reaction.message;