Method GetUserAsync
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
GetUserAsync(ulong, bool, CancellationToken)
Gets a user.
public Task<DiscordUser> GetUserAsync(ulong userId, bool fetch = false, CancellationToken cancellationToken = default)
Parameters
userIdulongId of the user
fetchboolWhether to ignore the cache. Defaults to false.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordUser>
The requested user.
Exceptions
- NotFoundException
Thrown when the user does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.