Appearance
UsersManager
Package: @erinjs/core
Manages users with fetch and profile helpers. Extends Collection so you can use .get(), .set(), .filter(), etc.
Constructor
| Name | Type | Optional | Description |
|---|---|---|---|
client | Client | No |
Properties
| Name | Type | Readonly | Optional | Description |
|---|---|---|---|---|
maxSize | number | Yes | No |
Methods
fetch() async
Fetch a user by ID from the API. Updates cache if user already exists.
Returns: Promise<User>
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
userId | string | No | Snowflake 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:
| Name | Type | Optional | Description |
|---|---|---|---|
userId | string | No | Snowflake of the user |
options | { guildId?: string | null; } | Yes | Optional guildId for server profile and member data |
set()
Returns: this
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
key | string | No | |
value | User | No |