[Feature] Bulk ban support (#2881)

This commit is contained in:
Mihail Gribkov
2024-03-16 01:22:23 +03:00
committed by GitHub
parent 3331614a7a
commit 03402cd4d2
8 changed files with 92 additions and 0 deletions

View File

@@ -244,6 +244,13 @@ namespace Discord.Rest
public static Task RemoveBanAsync(IGuild guild, BaseDiscordClient client, ulong userId, RequestOptions options)
=> client.ApiClient.RemoveGuildBanAsync(guild.Id, userId, options);
public static async Task<BulkBanResult> BulkBanAsync(IGuild guild, BaseDiscordClient client, ulong[] userIds, int? deleteMessageSeconds, RequestOptions options)
{
var model = await client.ApiClient.BulkBanAsync(guild.Id, userIds, deleteMessageSeconds, options);
return new(model.BannedUsers?.ToImmutableArray() ?? ImmutableArray<ulong>.Empty,
model.FailedUsers?.ToImmutableArray() ?? ImmutableArray<ulong>.Empty);
}
#endregion
#region Channels