Files
discordeno/src/helpers/webhooks/edit_webhook.ts
Skillz4Killz e0955df780 i love you
2021-11-10 19:06:24 +00:00

12 lines
574 B
TypeScript

import type { ModifyWebhook } from "../../types/webhooks/modify_webhook.ts";
import type { Webhook } from "../../types/webhooks/webhook.ts";
import type { Bot } from "../../bot.ts";
/** Edit a webhook. Requires the `MANAGE_WEBHOOKS` permission. Returns the updated webhook object on success. */
export async function editWebhook(bot: Bot, channelId: bigint, webhookId: bigint, options: ModifyWebhook) {
return await bot.rest.runMethod<Webhook>(bot.rest, "patch", bot.constants.endpoints.WEBHOOK_ID(webhookId), {
...options,
channel_id: options.channelId,
});
}