BREAKING CHANGE remove unused editWebhook function channelId parameter

and add comments to createWebhook and modifyWebhook interfaces' reason
This commit is contained in:
lts20050703
2022-01-26 17:19:31 +07:00
parent 0f28376bb6
commit 445f8bb085
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ 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) {
export async function editWebhook(bot: Bot, webhookId: bigint, options: ModifyWebhook) {
const result = await bot.rest.runMethod<Webhook>(bot.rest, "patch", bot.constants.endpoints.WEBHOOK_ID(webhookId), {
...options,
channel_id: options.channelId,
+1
View File
@@ -3,5 +3,6 @@ export interface CreateWebhook {
name: string;
/** Image for the default webhook avatar */
avatar?: string | null;
/** The reason you are creating this webhook */
reason?: string;
}
+1
View File
@@ -6,5 +6,6 @@ export interface ModifyWebhook {
avatar?: string | null;
/** The new channel id this webhook should be moved to */
channelId?: string;
/** The reason you are modifying this webhook */
reason?: string;
}