Table of Contents

Method GetBanAsync

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

GetBanAsync(ulong)

Gets a ban for a specific user.

public Task<DiscordBan> GetBanAsync(ulong userId)

Parameters

userId ulong

The ID of the user to get the ban for.

Returns

Task<DiscordBan>

The requested ban object.

Exceptions

NotFoundException

Thrown when the specified user is not banned.

GetBanAsync(DiscordUser)

Gets a ban for a specific user.

public Task<DiscordBan> GetBanAsync(DiscordUser user)

Parameters

user DiscordUser

The user to get the ban for.

Returns

Task<DiscordBan>

The requested ban object.

Exceptions

NotFoundException

Thrown when the specified user is not banned.