add: webhook thread support

This commit is contained in:
ITOH
2021-05-04 22:36:00 +02:00
parent c5cf4ba353
commit d16280512c
2 changed files with 5 additions and 3 deletions

View File

@@ -66,9 +66,9 @@ export async function sendWebhook(
const result = await rest.runMethod<Message>(
"post",
`${endpoints.WEBHOOK(webhookId, webhookToken)}${
options.wait ? "?wait=true" : ""
}`,
`${endpoints.WEBHOOK(webhookId, webhookToken)}?wait=${
options.wait ? "true" : "false"
}${options.threadId ? `&thread_id=${options.threadId}` : ""}`,
{
...options,
allowed_mentions: options.allowedMentions,

View File

@@ -7,6 +7,8 @@ import { SnakeCasedPropertiesDeep } from "../util.ts";
export interface ExecuteWebhook {
/** Waits for server confirmation of message send before response, and returns the created message body (defaults to `false`; when `false` a message that is not saved does not return an error) */
wait?: boolean;
/** Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived. */
threadId?: bigint;
/** The message contents (up to 2000 characters) */
content?: string;
/** Override the default username of the webhook */