mirror of
https://onedev.fprog.nl/DiscordClient
synced 2026-03-15 01:04:08 +01:00
Added SearchGuidMessages method.
This commit is contained in:
parent
0c164698ef
commit
e717332b12
|
|
@ -53,4 +53,13 @@ public class DiscordUserClient
|
||||||
string url = $"https://discord.com/api/v9/channels/{channelId}/messages/{messageId}";
|
string url = $"https://discord.com/api/v9/channels/{channelId}/messages/{messageId}";
|
||||||
return await _httpClient.DeleteAsync(url);
|
return await _httpClient.DeleteAsync(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<GuildMessageSearchResponse?> SearchGuildMessages(string guildId, string? authorId = null)
|
||||||
|
{
|
||||||
|
string authorQuery = authorId is not null ? $"?author_id={authorId}" : "";
|
||||||
|
string url =
|
||||||
|
$"https://discord.com/api/v9/guilds/{guildId}/messages/search{authorQuery}";
|
||||||
|
HttpResponseMessage response = await _httpClient.GetAsync(url);
|
||||||
|
return await response.Content.ReadFromJsonAsync<GuildMessageSearchResponse>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue