Skip to content

Commit

Permalink
added failsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-flip committed Sep 23, 2024
1 parent 5e69fdb commit 1c3af33
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions commands/broadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1c3af33

Please sign in to comment.