mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-31 07:50:07 +00:00
23 lines
572 B
TypeScript
23 lines
572 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
|
|
export interface DeleteWebhookMessageOptions {
|
|
/** id of the thread the message is in */
|
|
threadId: bigint;
|
|
}
|
|
|
|
export async function deleteWebhookMessage(
|
|
bot: Bot,
|
|
webhookId: bigint,
|
|
webhookToken: string,
|
|
messageId: bigint,
|
|
options?: DeleteWebhookMessageOptions,
|
|
) {
|
|
let url = bot.constants.endpoints.WEBHOOK_MESSAGE(webhookId, webhookToken, messageId);
|
|
|
|
// QUERY PARAMS
|
|
if (options?.threadId) {
|
|
url += `?threadId=${options.threadId}`;
|
|
}
|
|
await bot.rest.runMethod<undefined>(bot.rest, "delete", url);
|
|
}
|