Method TryGetBanAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
TryGetBanAsync(ulong, CancellationToken)
Tries to get a ban for a specific user.
public Task<DiscordBan?> TryGetBanAsync(ulong userId, CancellationToken cancellationToken = default)
Parameters
userIdulongThe Id of the user to get the ban for.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordBan>
The requested ban object or null if not found.
TryGetBanAsync(DiscordUser, CancellationToken)
Tries to get a ban for a specific user.
public Task<DiscordBan?> TryGetBanAsync(DiscordUser user, CancellationToken cancellationToken = default)
Parameters
userDiscordUserThe user to get the ban for.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordBan>
The requested ban object or null if not found.