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
membersList<DiscordMember>The members to ban.
deleteMessageSecondsintHow many seconds to remove messages from the users. Minimum
0seconds and maximum604800seconds (7 days).reasonstringReason for audit logs.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- ArgumentException
Thrown when
deleteMessageSecondswas too low or too high, or whenmemberscontains more than200members.- 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
usersList<DiscordUser>The users to ban.
deleteMessageSecondsintHow many seconds to remove messages from the users. Minimum
0seconds and maximum604800seconds (7 days).reasonstringReason for audit logs.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- ArgumentException
Thrown when
deleteMessageSecondswas too low or too high, or whenuserscontains more than200users.- 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
userIdsList<ulong>The user IDs to ban.
deleteMessageSecondsintHow many seconds to remove messages from the users. Minimum
0seconds and maximum604800seconds (7 days).reasonstringReason for audit logs.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- ArgumentException
Thrown when
deleteMessageSecondswas too low or too high, or whenuserIdscontains more than200user 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.