Table of Contents

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

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 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

user DiscordUser

The user to get the ban for.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordBan>

The requested ban object or null if not found.