Method GetBanAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
GetBanAsync(ulong, CancellationToken)
Gets a ban for a specific user.
public Task<DiscordBan> GetBanAsync(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.
Exceptions
- NotFoundException
Thrown when the specified user is not banned.
GetBanAsync(DiscordUser, CancellationToken)
Gets a ban for a specific user.
public Task<DiscordBan> GetBanAsync(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.
Exceptions
- NotFoundException
Thrown when the specified user is not banned.