Table of Contents

Method BulkBanMembersAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

BulkBanMembersAsync(List<DiscordMember>, int, string?, CancellationToken)

Bulk bans a list of DiscordMembers from this guild.

public Task<DiscordBulkBanResponse> BulkBanMembersAsync(List<DiscordMember> members, int deleteMessageSeconds = 0, string? reason = null, CancellationToken cancellationToken = default)

Parameters

members List<DiscordMember>

The members to ban.

deleteMessageSeconds int

How many seconds to remove messages from the users. Minimum 0 seconds and maximum 604800 seconds (7 days).

reason string

Reason for audit logs.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordBulkBanResponse>

Exceptions

ArgumentException

Thrown when deleteMessageSeconds was too low or too high, or when members contains more than 200 members.

UnauthorizedException

Thrown when the client does not have the BanMembers or ManageGuild permission.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

BulkBanMembersAsync(List<DiscordUser>, int, string?, CancellationToken)

Bulk bans a list of DiscordUsers from this guild. This doesn't require the users to be in this guild.

public Task<DiscordBulkBanResponse> BulkBanMembersAsync(List<DiscordUser> users, int deleteMessageSeconds = 0, string? reason = null, CancellationToken cancellationToken = default)

Parameters

users List<DiscordUser>

The users to ban.

deleteMessageSeconds int

How many seconds to remove messages from the users. Minimum 0 seconds and maximum 604800 seconds (7 days).

reason string

Reason for audit logs.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordBulkBanResponse>

Exceptions

ArgumentException

Thrown when deleteMessageSeconds was too low or too high, or when users contains more than 200 users.

UnauthorizedException

Thrown when the client does not have the BanMembers or ManageGuild permission.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

BulkBanMembersAsync(List<ulong>, int, string, CancellationToken)

Bans a list of user IDs from this guild. This doesn't require the users to be in this guild.

public Task<DiscordBulkBanResponse> BulkBanMembersAsync(List<ulong> userIds, int deleteMessageSeconds = 0, string reason = null, CancellationToken cancellationToken = default)

Parameters

userIds List<ulong>

The user IDs to ban.

deleteMessageSeconds int

How many seconds to remove messages from the users. Minimum 0 seconds and maximum 604800 seconds (7 days).

reason string

Reason for audit logs.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<DiscordBulkBanResponse>

Exceptions

ArgumentException

Thrown when deleteMessageSeconds was too low or too high, or when userIds contains more than 200 user ids.

UnauthorizedException

Thrown when the client does not have the BanMembers or ManageGuild permission.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.