Implement GetBanAsync (#1056)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Discord.API.Rest;
|
||||
using Discord.API.Rest;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
@@ -111,6 +111,11 @@ namespace Discord.Rest
|
||||
var models = await client.ApiClient.GetGuildBansAsync(guild.Id, options).ConfigureAwait(false);
|
||||
return models.Select(x => RestBan.Create(client, x)).ToImmutableArray();
|
||||
}
|
||||
public static async Task<RestBan> GetBanAsync(IGuild guild, BaseDiscordClient client, ulong userId, RequestOptions options)
|
||||
{
|
||||
var model = await client.ApiClient.GetGuildBanAsync(guild.Id, userId, options).ConfigureAwait(false);
|
||||
return RestBan.Create(client, model);
|
||||
}
|
||||
|
||||
public static async Task AddBanAsync(IGuild guild, BaseDiscordClient client,
|
||||
ulong userId, int pruneDays, string reason, RequestOptions options)
|
||||
|
||||
Reference in New Issue
Block a user