Class

UserManager

User cache + fetch/profile helpers. Extends Collection (`.get()`, `.set()`, `.filter()`, …). Access via Client.

Extends Collection

Constructor

new UserManager(client: Client)
ParamTypeDescription
clientClient

Properties

maxSize: number (readonly)

Methods

fetch(userId: string): Promise<User>

Fetch a user by ID and update cache.

ParamTypeDescription
userIdstring
fetchWithProfile(userId: string, options?: { guildId?: string | null; }): Promise<FetchedUserWithProfile>

Fetch user + profiles (+ optional guild member). Ideal for userinfo commands.

ParamTypeDescription
userIdstring
options?{ guildId?: string | null; }
set(key: string, value: User): this
ParamTypeDescription
keystring
valueUser
sweep(filter?: (user: User, id: string) => boolean): number

Remove matching users (skips `client.user`). Returns count removed.

ParamTypeDescription
filter?(user: User, id: string) => boolean