Table of Contents

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

userId ulong

The Id of the user to get the ban for.

cancellationToken CancellationToken

A 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

user DiscordUser

The user to get the ban for.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordBan>

The requested ban object.

Exceptions

NotFoundException

Thrown when the specified user is not banned.