mirror of
https://onedev.fprog.nl/DiscordClient
synced 2026-02-20 06:53:42 +01:00
Included offset in SearchGuildMessages.
This commit is contained in:
parent
906df00e59
commit
457fc8a9c5
|
|
@ -65,11 +65,13 @@ public class DiscordUserClient
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<GuildMessageSearchResponse?> SearchGuildMessages(
|
public async Task<GuildMessageSearchResponse?> SearchGuildMessages(
|
||||||
string guildId,
|
string guildId,
|
||||||
|
ulong offset,
|
||||||
string? authorId = null
|
string? authorId = null
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
string authorQuery = authorId is not null ? $"?author_id={authorId}" : "";
|
string authorQuery = authorId is not null ? $"&author_id={authorId}" : "";
|
||||||
string url = $"https://discord.com/api/v9/guilds/{guildId}/messages/search{authorQuery}";
|
string url =
|
||||||
|
$"https://discord.com/api/v9/guilds/{guildId}/messages/search?offset={offset}{authorQuery}";
|
||||||
HttpResponseMessage response = await _httpClient.GetAsync(url);
|
HttpResponseMessage response = await _httpClient.GetAsync(url);
|
||||||
return await response.Content.ReadFromJsonAsync<GuildMessageSearchResponse>();
|
return await response.Content.ReadFromJsonAsync<GuildMessageSearchResponse>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue