mirror of
https://onedev.fprog.nl/DiscordClient
synced 2026-01-26 15:03:42 +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(
|
public async Task<ChannelMessagesResponse[]?> GetChannelMessages(
|
||||||
string channelId,
|
string channelId,
|
||||||
|
int offset = 0,
|
||||||
int limit = 50
|
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);
|
HttpResponseMessage response = await _httpClient.GetAsync(url);
|
||||||
return await response.Content.ReadFromJsonAsync<ChannelMessagesResponse[]>();
|
return await response.Content.ReadFromJsonAsync<ChannelMessagesResponse[]>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue