mirror of
https://onedev.fprog.nl/DiscordClient
synced 2026-02-28 17:43:42 +01:00
Limit is no longer necessary.
This commit is contained in:
parent
a147856013
commit
82fe3813a6
|
|
@ -22,11 +22,11 @@ public class DiscordUserClient
|
||||||
public async Task<(
|
public async Task<(
|
||||||
HttpResponseMessage Response,
|
HttpResponseMessage Response,
|
||||||
MessageSearchResponse? JsonData
|
MessageSearchResponse? JsonData
|
||||||
)> GetChannelMessages(string channelId, int offset = 0, string? authorId = null, int limit = 50)
|
)> GetChannelMessages(string channelId, int offset = 0, string? authorId = null)
|
||||||
{
|
{
|
||||||
string authorQuery = authorId is not null ? $"&author_id={authorId}" : "";
|
string authorQuery = authorId is not null ? $"&author_id={authorId}" : "";
|
||||||
string url =
|
string url =
|
||||||
$"https://discord.com/api/v9/channels/{channelId}/messages/search?limit={limit}&offset={offset}{authorQuery}";
|
$"https://discord.com/api/v9/channels/{channelId}/messages/search?offset={offset}{authorQuery}";
|
||||||
HttpResponseMessage response = await _httpClient.GetAsync(url);
|
HttpResponseMessage response = await _httpClient.GetAsync(url);
|
||||||
return (response, await response.Content.ReadFromJsonAsync<MessageSearchResponse>());
|
return (response, await response.Content.ReadFromJsonAsync<MessageSearchResponse>());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue