Document X-Audit-Log-Reason on webhook endpoints

This commit is contained in:
lts20050703
2022-01-26 10:36:12 +07:00
parent 4ed54a91b5
commit 0f28376bb6
3 changed files with 4 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import type { Bot } from "../../bot.ts";
/** Delete a webhook permanently. Requires the `MANAGE_WEBHOOKS` permission. Returns a undefined on success */
export async function deleteWebhook(bot: Bot, channelId: bigint, webhookId: bigint) {
await bot.rest.runMethod<undefined>(bot.rest, "delete", bot.constants.endpoints.WEBHOOK_ID(webhookId));
export async function deleteWebhook(bot: Bot, channelId: bigint, webhookId: bigint, reason?: string) {
await bot.rest.runMethod<undefined>(bot.rest, "delete", bot.constants.endpoints.WEBHOOK_ID(webhookId), { reason });
}

View File

@@ -3,4 +3,5 @@ export interface CreateWebhook {
name: string;
/** Image for the default webhook avatar */
avatar?: string | null;
reason?: string;
}

View File

@@ -6,4 +6,5 @@ export interface ModifyWebhook {
avatar?: string | null;
/** The new channel id this webhook should be moved to */
channelId?: string;
reason?: string;
}