diff --git a/src/Disqord.Core/Models/Application/ApplicationEmojisJsonModel.cs b/src/Disqord.Core/Models/Application/ApplicationEmojisJsonModel.cs new file mode 100644 index 000000000..b83b8c5dd --- /dev/null +++ b/src/Disqord.Core/Models/Application/ApplicationEmojisJsonModel.cs @@ -0,0 +1,9 @@ +using Disqord.Serialization.Json; + +namespace Disqord.Models; + +public class ApplicationEmojisJsonModel : JsonModel +{ + [JsonProperty("items")] + public EmojiJsonModel[] Items = null!; +} \ No newline at end of file diff --git a/src/Disqord.Rest.Api/Methods/RestApiClientExtensions.Emoji.cs b/src/Disqord.Rest.Api/Methods/RestApiClientExtensions.Emoji.cs index 79cb81cf8..5d64b84c7 100644 --- a/src/Disqord.Rest.Api/Methods/RestApiClientExtensions.Emoji.cs +++ b/src/Disqord.Rest.Api/Methods/RestApiClientExtensions.Emoji.cs @@ -6,12 +6,12 @@ namespace Disqord.Rest.Api; public static partial class RestApiClientExtensions { - public static Task FetchApplicationEmojisAsync(this IRestApiClient client, + public static Task FetchApplicationEmojisAsync(this IRestApiClient client, Snowflake applicationId, IRestRequestOptions? options = null, CancellationToken cancellationToken = default) { var route = Format(Route.Emoji.GetApplicationEmojis, applicationId); - return client.ExecuteAsync(route, null, options, cancellationToken); + return client.ExecuteAsync(route, null, options, cancellationToken); } public static Task FetchApplicationEmojiAsync(this IRestApiClient client, diff --git a/src/Disqord.Rest/Extensions/RestClientExtensions.Emoji.cs b/src/Disqord.Rest/Extensions/RestClientExtensions.Emoji.cs index 4df3da06b..1a495d82b 100644 --- a/src/Disqord.Rest/Extensions/RestClientExtensions.Emoji.cs +++ b/src/Disqord.Rest/Extensions/RestClientExtensions.Emoji.cs @@ -16,8 +16,8 @@ public static async Task> FetchApplicationEmoji Snowflake applicationId, IRestRequestOptions? options = null, CancellationToken cancellationToken = default) { - var models = await client.ApiClient.FetchApplicationEmojisAsync(applicationId, options, cancellationToken).ConfigureAwait(false); - return models.ToReadOnlyList((client, applicationId), static (model, state) => + var model = await client.ApiClient.FetchApplicationEmojisAsync(applicationId, options, cancellationToken).ConfigureAwait(false); + return model.Items.ToReadOnlyList((client, applicationId), static (model, state) => { var (client, applicationId) = state; return new TransientApplicationEmoji(client, applicationId, model);