From d1504ed4e8997cbe98bc1823f3017226b5bf338a Mon Sep 17 00:00:00 2001 From: Filip Strajnar Date: Thu, 25 Apr 2024 23:51:10 +0200 Subject: [PATCH] Added offset option to GetChannelMessages. --- DiscordClient/DiscordUserClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DiscordClient/DiscordUserClient.cs b/DiscordClient/DiscordUserClient.cs index e3b87ff..2f592e2 100644 --- a/DiscordClient/DiscordUserClient.cs +++ b/DiscordClient/DiscordUserClient.cs @@ -20,10 +20,11 @@ public class DiscordUserClient public async Task GetChannelMessages( string channelId, + int offset = 0, int limit = 50 ) { - string url = $"https://discord.com/api/v9/channels/{channelId}/messages?limit={limit}"; + string url = $"https://discord.com/api/v9/channels/{channelId}/messages?limit={limit}&offset={offset}"; HttpResponseMessage response = await _httpClient.GetAsync(url); return await response.Content.ReadFromJsonAsync(); }