From 1c3af3338f7f345815cf162771ee02cf70bc39e6 Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 23 Sep 2024 20:04:14 +0200 Subject: [PATCH] added failsafe --- commands/broadcast.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/broadcast.js b/commands/broadcast.js index b7728e9..c7b9c80 100644 --- a/commands/broadcast.js +++ b/commands/broadcast.js @@ -33,6 +33,7 @@ module.exports.run = async (interaction) => { const channels = await getChannels(); channels.forEach(async (postChannel) => { const channel = client.channels.cache.get(postChannel.logChannelID); + if (!channel) return console.log(`${postChannel.logChannelID} doesn't exist.`); let errCreateWebhook = false; const channelWebhooks = await channel.fetchWebhooks().catch((err) => { errCreateWebhook = true;