Method TryGetMemberAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
TryGetMemberAsync(ulong, bool, CancellationToken)
Gets a member of this guild by their user ID.
public Task<DiscordMember?> TryGetMemberAsync(ulong userId, bool fetch = false, CancellationToken cancellationToken = default)
Parameters
userIdulongID of the member to get.
fetchboolWhether to fetch the member from the api prior to cache.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordMember>
The requested DiscordMember if the member was found, otherwise null.
Exceptions
- ServerErrorException
Thrown when Discord is unable to process the request.