Class: UserManager

UserManager

Manages API methods for users and stores their cache.

Constructor

new UserManager()

Source:

Extends

Members

cache :Collection.<Snowflake, User>

The cache of this manager
Type:
Overrides:
Source:

cacheType :Collection

The type of Collection of the Manager
Type:
  • Collection
Overrides:
Source:

(readonly) client :Client

The client that instantiated this Manager
Type:
Overrides:
Source:

(private, readonly) holds :function

The data structure belonging to this manager
Type:
  • function
Overrides:
Source:

Methods

fetch(id, cacheopt, forceopt) → {Promise.<User>}

Obtains a user from Discord, or the user cache if it's already available.
Parameters:
Name Type Attributes Default Description
id Snowflake ID of the user
cache boolean <optional>
true Whether to cache the new user object if it isn't already
force boolean <optional>
false Whether to skip the cache check and request the API
Source:
Returns:
Type
Promise.<User>

resolve(user) → {User}

Resolves a UserResolvable to a User object.
Parameters:
Name Type Description
user UserResolvable The UserResolvable to identify
Overrides:
Source:
Returns:
Type
User

resolveID(user) → {Snowflake}

Resolves a UserResolvable to a user ID string.
Parameters:
Name Type Description
user UserResolvable The UserResolvable to identify
Overrides:
Source:
Returns:
Type
Snowflake