diff --git a/DiscordClient/DiscordUserClient.cs b/DiscordClient/DiscordUserClient.cs index 35008be..168de0e 100644 --- a/DiscordClient/DiscordUserClient.cs +++ b/DiscordClient/DiscordUserClient.cs @@ -37,16 +37,20 @@ public class DiscordUserClient return await GetShortProfile("@me"); } - public async Task<( - HttpResponseMessage Response, - MessageSearchResponse? JsonData - )> GetChannelMessages(string channelId, int offset = 0, string? authorId = null) + public async Task> GetChannelMessages( + string channelId, + int offset = 0, + string? authorId = null + ) { string authorQuery = authorId is not null ? $"&author_id={authorId}" : ""; string url = $"https://discord.com/api/v9/channels/{channelId}/messages/search?offset={offset}{authorQuery}"; HttpResponseMessage response = await _httpClient.GetAsync(url); - return (response, await response.Content.ReadFromJsonAsync()); + return new HttpData( + response, + await response.Content.ReadFromJsonAsync() + ); } sealed class MessageContent @@ -84,15 +88,19 @@ public class DiscordUserClient /// recent messages from this particular author. /// /// - public async Task<( - HttpResponseMessage Response, - MessageSearchResponse? JsonData - )> SearchGuildMessages(string guildId, int offset, string? authorId = null) + public async Task> SearchGuildMessages( + string guildId, + int offset, + string? authorId = null + ) { string authorQuery = authorId is not null ? $"&author_id={authorId}" : ""; string url = $"https://discord.com/api/v9/guilds/{guildId}/messages/search?offset={offset}{authorQuery}"; HttpResponseMessage response = await _httpClient.GetAsync(url); - return (response, await response.Content.ReadFromJsonAsync()); + return new HttpData( + response, + await response.Content.ReadFromJsonAsync() + ); } }