diff --git a/src/Discord.Net.Core/IDiscordClient.cs b/src/Discord.Net.Core/IDiscordClient.cs index 431d5816..91709989 100644 --- a/src/Discord.Net.Core/IDiscordClient.cs +++ b/src/Discord.Net.Core/IDiscordClient.cs @@ -343,7 +343,7 @@ namespace Discord /// IAsyncEnumerable> GetEntitlementsAsync(int limit = 100, ulong? afterId = null, ulong? beforeId = null, bool excludeEnded = false, ulong? guildId = null, ulong? userId = null, - ulong[] skuIds = null, RequestOptions options = null); + ulong[] skuIds = null, RequestOptions options = null, bool? excludeDeleted = null); /// /// Returns all SKUs for a given application. diff --git a/src/Discord.Net.Rest/API/Rest/ListEntitlementsParams.cs b/src/Discord.Net.Rest/API/Rest/ListEntitlementsParams.cs index 6e569efc..5363634a 100644 --- a/src/Discord.Net.Rest/API/Rest/ListEntitlementsParams.cs +++ b/src/Discord.Net.Rest/API/Rest/ListEntitlementsParams.cs @@ -15,4 +15,6 @@ internal class ListEntitlementsParams public Optional GuildId { get; set; } public Optional ExcludeEnded { get; set; } + + public Optional ExcludeDeleted { get; set; } } diff --git a/src/Discord.Net.Rest/BaseDiscordClient.cs b/src/Discord.Net.Rest/BaseDiscordClient.cs index 5eb56b6b..a242dc77 100644 --- a/src/Discord.Net.Rest/BaseDiscordClient.cs +++ b/src/Discord.Net.Rest/BaseDiscordClient.cs @@ -287,7 +287,7 @@ namespace Discord.Rest /// Returns all entitlements for a given app. /// IAsyncEnumerable> IDiscordClient.GetEntitlementsAsync(int limit, ulong? afterId, ulong? beforeId, - bool excludeEnded, ulong? guildId, ulong? userId, ulong[] skuIds, RequestOptions options) => AsyncEnumerable.Empty>(); + bool excludeEnded, ulong? guildId, ulong? userId, ulong[] skuIds, RequestOptions options, bool? excludeDeleted) => AsyncEnumerable.Empty>(); /// /// Gets all SKUs for a given application. diff --git a/src/Discord.Net.Rest/ClientHelper.cs b/src/Discord.Net.Rest/ClientHelper.cs index 8eb94487..d7d72511 100644 --- a/src/Discord.Net.Rest/ClientHelper.cs +++ b/src/Discord.Net.Rest/ClientHelper.cs @@ -405,7 +405,7 @@ namespace Discord.Rest public static IAsyncEnumerable> ListEntitlementsAsync(BaseDiscordClient client, int? limit = 100, ulong? afterId = null, ulong? beforeId = null, bool excludeEnded = false, ulong? guildId = null, ulong? userId = null, - ulong[] skuIds = null, RequestOptions options = null) + ulong[] skuIds = null, bool? excludeDeleted = null, RequestOptions options = null) { return new PagedAsyncEnumerable( DiscordConfig.MaxEntitlementsPerBatch, @@ -419,6 +419,7 @@ namespace Discord.Rest GuildId = guildId ?? Optional.Unspecified, UserId = userId ?? Optional.Unspecified, SkuIds = skuIds ?? Optional.Unspecified, + ExcludeDeleted = excludeDeleted ?? Optional.Unspecified }; if (info.Position != null) args.AfterId = info.Position.Value; diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 91d533a5..e5257c8d 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -2842,6 +2842,11 @@ namespace Discord.API query += $"&exclude_ended={args.ExcludeEnded.Value}"; } + if (args.ExcludeDeleted.IsSpecified) + { + query += $"&exclude_deleted={args.ExcludeDeleted.Value}"; + } + return SendAsync("GET", () => $"applications/{CurrentApplicationId}/entitlements{query}", new BucketIds(), options: options); } diff --git a/src/Discord.Net.Rest/DiscordRestClient.cs b/src/Discord.Net.Rest/DiscordRestClient.cs index 2a010e7b..a59ac3e7 100644 --- a/src/Discord.Net.Rest/DiscordRestClient.cs +++ b/src/Discord.Net.Rest/DiscordRestClient.cs @@ -289,8 +289,8 @@ namespace Discord.Rest /// public IAsyncEnumerable> GetEntitlementsAsync(int? limit = 100, ulong? afterId = null, ulong? beforeId = null, bool excludeEnded = false, ulong? guildId = null, ulong? userId = null, - ulong[] skuIds = null, RequestOptions options = null) - => ClientHelper.ListEntitlementsAsync(this, limit, afterId, beforeId, excludeEnded, guildId, userId, skuIds, options); + ulong[] skuIds = null, RequestOptions options = null, bool? excludeDeleted = null) + => ClientHelper.ListEntitlementsAsync(this, limit, afterId, beforeId, excludeEnded, guildId, userId, skuIds, excludeDeleted, options); /// public Task> GetSKUsAsync(RequestOptions options = null) diff --git a/src/Discord.Net.WebSocket/DiscordSocketClient.cs b/src/Discord.Net.WebSocket/DiscordSocketClient.cs index cc6753d1..cb7ba9b9 100644 --- a/src/Discord.Net.WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net.WebSocket/DiscordSocketClient.cs @@ -442,8 +442,8 @@ namespace Discord.WebSocket /// public IAsyncEnumerable> GetEntitlementsAsync(int? limit = 100, ulong? afterId = null, ulong? beforeId = null, bool excludeEnded = false, ulong? guildId = null, ulong? userId = null, - ulong[] skuIds = null, RequestOptions options = null) - => ClientHelper.ListEntitlementsAsync(this, limit, afterId, beforeId, excludeEnded, guildId, userId, skuIds, options); + ulong[] skuIds = null, RequestOptions options = null, bool? excludeDeleted = null) + => ClientHelper.ListEntitlementsAsync(this, limit, afterId, beforeId, excludeEnded, guildId, userId, skuIds, excludeDeleted, options); /// public Task> GetSKUsAsync(RequestOptions options = null)