.fetch(userId, options?)
userId: string, options?: { force?: boolean; } → Promise<User>
Fetch a user by ID and update cache. Returns cache unless force is set.
await client.users.fetch(userId);Class
User cache + fetch/profile helpers. Extends LimitedCollection (.get(), .set(), .filter(), …). Access via client.users.
Extends LimitedCollection
new UserManager(client: Client)ClientuserId: string, options?: { force?: boolean; } → Promise<User>
Fetch a user by ID and update cache. Returns cache unless force is set.
await client.users.fetch(userId);userId: string, options?: { guildId?: string | null; } → Promise<FetchedUserWithProfile>
Fetch user + profiles (+ optional guild member). Ideal for userinfo commands.
const { user, globalProfile, member } = await client.users.fetchWithProfile(
userId,
{ guildId: message.guildId ?? undefined },
);userId: string → Promise<User>
Return a cached user, otherwise fetch.
await client.users.resolve(userId);filter?: (user: User, id: string) => boolean → number
Remove matching users (skips client.user). Returns count removed.
client.users.sweep();