mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Preliminary support for APIv9 and threads
This commit is contained in:
parent
0e7bcb993e
commit
1f2b9f998d
19 changed files with 127 additions and 24 deletions
|
|
@ -22,7 +22,7 @@ namespace Myriad.Rest
|
|||
{
|
||||
public class BaseRestClient: IAsyncDisposable
|
||||
{
|
||||
private const string ApiBaseUrl = "https://discord.com/api/v8";
|
||||
private const string ApiBaseUrl = "https://discord.com/api/v9";
|
||||
|
||||
private readonly Version _httpVersion = new(2, 0);
|
||||
private readonly JsonSerializerOptions _jsonSerializerOptions;
|
||||
|
|
|
|||
|
|
@ -116,9 +116,15 @@ namespace Myriad.Rest
|
|||
_client.Get<Webhook[]>($"/channels/{channelId}/webhooks", ("GetChannelWebhooks", channelId))!;
|
||||
|
||||
public Task<Message> ExecuteWebhook(ulong webhookId, string webhookToken, ExecuteWebhookRequest request,
|
||||
MultipartFile[]? files = null) =>
|
||||
_client.PostMultipart<Message>($"/webhooks/{webhookId}/{webhookToken}?wait=true",
|
||||
MultipartFile[]? files = null, ulong? threadId = null)
|
||||
{
|
||||
var url = $"/webhooks/{webhookId}/{webhookToken}?wait=true";
|
||||
if (threadId != null)
|
||||
url += $"&thread_id={threadId}";
|
||||
|
||||
return _client.PostMultipart<Message>(url,
|
||||
("ExecuteWebhook", webhookId), request, files)!;
|
||||
}
|
||||
|
||||
public Task<Message> EditWebhookMessage(ulong webhookId, string webhookToken, ulong messageId,
|
||||
WebhookMessageEditRequest request) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue