Skip to content

UsersManager

Package: @erinjs/core

Manages users with fetch and profile helpers. Extends Collection so you can use .get(), .set(), .filter(), etc.

Constructor

NameTypeOptionalDescription
clientClientNo

Properties

NameTypeReadonlyOptionalDescription
maxSizenumberYesNo

Methods

fetch() async

Fetch a user by ID from the API. Updates cache if user already exists.

Returns: Promise<User>

Parameters:

NameTypeOptionalDescription
userIdstringNoSnowflake of the user

fetchWithProfile() async

Fetch a user with full profile and optional guild context. Returns user, global profile, server profile (when guildId), and member (when guildId). Ideal for userinfo commands.

Returns: Promise<FetchedUserWithProfile>

Parameters:

NameTypeOptionalDescription
userIdstringNoSnowflake of the user
options{ guildId?: string | null; }YesOptional guildId for server profile and member data

set()

Returns: this

Parameters:

NameTypeOptionalDescription
keystringNo
valueUserNo

Released under the Apache-2.0 License.