From 307a9a83fed8f7e7326e38e35f764cb750be7748 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Mon, 21 Mar 2022 08:24:37 +0000 Subject: [PATCH] fix: edit webhook perm checking --- plugins/permissions/src/webhooks/editWebhook.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/permissions/src/webhooks/editWebhook.ts b/plugins/permissions/src/webhooks/editWebhook.ts index 56ee4c37e..ad980c440 100644 --- a/plugins/permissions/src/webhooks/editWebhook.ts +++ b/plugins/permissions/src/webhooks/editWebhook.ts @@ -4,8 +4,10 @@ import { requireBotChannelPermissions } from "../permissions.ts"; export default function editWebhook(bot: BotWithCache) { const editWebhookOld = bot.helpers.editWebhook; - bot.helpers.editWebhook = async function (webhookId, options) { + // @ts-ignore TODO: itoh need a better way for this + bot.helpers.editWebhook = async function (webhookId, options, channelId) { if (options.channelId) requireBotChannelPermissions(bot, options.channelId, ["MANAGE_WEBHOOKS"]); + if (channelId) requireBotChannelPermissions(bot, channelId, ["MANAGE_WEBHOOKS"]); if (options.name) { if (