mirror of
https://onedev.fprog.nl/DiscordClient
synced 2025-12-29 10:18:36 +01:00
Added offset option to GetChannelMessages.
This commit is contained in:
parent
457fc8a9c5
commit
d1504ed4e8
|
|
@ -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[]>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue