Implement GetBanAsync (#1056)
This commit is contained in:
@@ -288,6 +288,10 @@ namespace Discord.WebSocket
|
||||
//Bans
|
||||
public Task<IReadOnlyCollection<RestBan>> GetBansAsync(RequestOptions options = null)
|
||||
=> GuildHelper.GetBansAsync(this, Discord, options);
|
||||
public Task<RestBan> GetBanAsync(IUser user, RequestOptions options = null)
|
||||
=> GuildHelper.GetBanAsync(this, Discord, user.Id, options);
|
||||
public Task<RestBan> GetBanAsync(ulong userId, RequestOptions options = null)
|
||||
=> GuildHelper.GetBanAsync(this, Discord, userId, options);
|
||||
|
||||
public Task AddBanAsync(IUser user, int pruneDays = 0, string reason = null, RequestOptions options = null)
|
||||
=> GuildHelper.AddBanAsync(this, Discord, user.Id, pruneDays, reason, options);
|
||||
@@ -641,6 +645,12 @@ namespace Discord.WebSocket
|
||||
|
||||
async Task<IReadOnlyCollection<IBan>> IGuild.GetBansAsync(RequestOptions options)
|
||||
=> await GetBansAsync(options).ConfigureAwait(false);
|
||||
/// <inheritdoc/>
|
||||
async Task<IBan> IGuild.GetBanAsync(IUser user, RequestOptions options)
|
||||
=> await GetBanAsync(user, options).ConfigureAwait(false);
|
||||
/// <inheritdoc/>
|
||||
async Task<IBan> IGuild.GetBanAsync(ulong userId, RequestOptions options)
|
||||
=> await GetBanAsync(userId, options).ConfigureAwait(false);
|
||||
|
||||
Task<IReadOnlyCollection<IGuildChannel>> IGuild.GetChannelsAsync(CacheMode mode, RequestOptions options)
|
||||
=> Task.FromResult<IReadOnlyCollection<IGuildChannel>>(Channels);
|
||||
|
||||
Reference in New Issue
Block a user