Added offset option to GetChannelMessages.

This commit is contained in:
Filip Strajnar 2024-04-25 23:51:10 +02:00
parent 457fc8a9c5
commit d1504ed4e8

View file

@ -20,10 +20,11 @@ public class DiscordUserClient
public async Task<ChannelMessagesResponse[]?> 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<ChannelMessagesResponse[]>();
}