fix: Check error 404 and return null for GetBanAsync (#1614)
This commit is contained in:
@@ -132,7 +132,7 @@ namespace Discord.Rest
|
||||
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);
|
||||
return model == null ? null : RestBan.Create(client, model);
|
||||
}
|
||||
|
||||
public static async Task AddBanAsync(IGuild guild, BaseDiscordClient client,
|
||||
|
||||
Reference in New Issue
Block a user