Table of Contents

Method GetBansAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

GetBansAsync(int?, ulong?, ulong?)

Gets the bans for this guild, allowing for pagination.

public Task<IReadOnlyList<DiscordBan>> GetBansAsync(int? limit = null, ulong? before = null, ulong? after = null)

Parameters

limit int?

Maximum number of bans to fetch. Max 1000. Defaults to 1000.

before ulong?

The Id of the user before which to fetch the bans. Overrides after if both are present.

after ulong?

The Id of the user after which to fetch the bans.

Returns

Task<IReadOnlyList<DiscordBan>>

Collection of bans in this guild in ascending order by user id.

Exceptions

UnauthorizedException

Thrown when the client does not have the BanMembers permission.

ServerErrorException

Thrown when Discord is unable to process the request.