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