From 7765f9a34bbe535826f15cd01fec026b49d92268 Mon Sep 17 00:00:00 2001 From: GamesTwoLifeTwoLife Date: Fri, 15 Dec 2023 18:00:19 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B4=D0=BE=D0=B4=D0=B0=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D1=96=D1=80=D0=BA=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B0=D1=8F=D0=B2=D0=BD=D1=96=D1=81=D1=82=D1=8C?= =?UTF-8?q?=20=D0=BA=D0=B0=D0=BD=D0=B0=D0=BB=D1=83=20=D0=BB=D0=BE=D0=B3?= =?UTF-8?q?=D1=96=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index ea7152a..7d59d90 100644 --- a/index.js +++ b/index.js @@ -59,7 +59,7 @@ process.on('unhandledRejection', async (error) => { */ const channel = client.channels.cache.get(channelId); - if (!channel || !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(error); + if (!channel || channel && !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(error); try { const webhooks = await channel.fetchWebhooks(); @@ -100,7 +100,7 @@ process.on('uncaughtException', async (error) => { */ const channel = client.channels.cache.get(channelId); - if (!channel || !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(error); + if (!channel || channel && !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(error); try { const webhooks = await channel.fetchWebhooks(); @@ -141,7 +141,7 @@ process.on('rejectionHandled', async (error) => { */ const channel = client.channels.cache.get(channelId); - if (!channel || !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(error); + if (!channel || channel && !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(error); try { const webhooks = await channel.fetchWebhooks(); @@ -182,7 +182,7 @@ process.on('warning', async (warning) => { */ const channel = client.channels.cache.get(channelId); - if (!channel || !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(warning); + if (!channel || channel && !channel.permissionsFor(client.user.id).has([PermissionsBitField.Flags.ManageChannels, PermissionsBitField.Flags.ManageWebhooks])) return console.error(warning); try { const webhooks = await channel.fetchWebhooks();