Method BulkBanMembersAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
BulkBanMembersAsync(List<DiscordMember>, int, string?)
Bulk bans a list of DiscordMembers from this guild.
public Task<DiscordBulkBanResponse> BulkBanMembersAsync(List<DiscordMember> members, int deleteMessageSeconds = 0, string? reason = null)
Parameters
members
List<DiscordMember>The members to ban.
deleteMessageSeconds
intHow many seconds to remove messages from the users. Minimum
0
seconds and maximum604800
seconds (7 days).reason
stringReason for audit logs.
Returns
Exceptions
- ArgumentException
Thrown when
deleteMessageSeconds
was too low or too high, or whenmembers
contains more than200
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?)
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)
Parameters
users
List<DiscordUser>The users to ban.
deleteMessageSeconds
intHow many seconds to remove messages from the users. Minimum
0
seconds and maximum604800
seconds (7 days).reason
stringReason for audit logs.
Returns
Exceptions
- ArgumentException
Thrown when
deleteMessageSeconds
was too low or too high, or whenusers
contains more than200
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)
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)
Parameters
userIds
List<ulong>The user IDs to ban.
deleteMessageSeconds
intHow many seconds to remove messages from the users. Minimum
0
seconds and maximum604800
seconds (7 days).reason
stringReason for audit logs.
Returns
Exceptions
- ArgumentException
Thrown when
deleteMessageSeconds
was too low or too high, or whenuserIds
contains more than200
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.