fetchUser

async fetchUser(userId: string) Promise<User | null>

Fetches a user from Discord by ID. Returns null when Discord reports that the user does not exist.

Example

const user = await discord.fetchUser('123456789012345678');
if (user) console.log(user.displayName);
Parameters:
  • userId — – The user ID to fetch.