Table of Contents

Method GetUserAsync

Namespace
DSharpPlus
Assembly
DSharpPlus.dll

GetUserAsync(ulong, bool)

Gets a user

public Task<DiscordUser> GetUserAsync(ulong userId, bool updateCache = false)

Parameters

userId ulong

ID of the user

updateCache bool

Whether to always make a REST request and update cache. Passing true will update the user, updating stale properties such as BannerHash.

Returns

Task<DiscordUser>

Exceptions

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.