From ea374e10614e89f0a2d9db30bc9b4bdcaeb3d060 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sun, 25 Jul 2021 11:03:11 -0600 Subject: [PATCH] importante push --- events/channelCreate.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/events/channelCreate.js b/events/channelCreate.js index 07aa2a4..f3e71a7 100644 --- a/events/channelCreate.js +++ b/events/channelCreate.js @@ -1,14 +1,16 @@ const Discord = require('discord.js'); module.exports = (client, channel) => { - let ts = client.guildconfig.logs.has(channel.guild.id) && client.guildconfig.logs.get(channel.guild.id).has('ch') ? client.guildconfig.logs.get(channel.guild.id).get('ch') : null; - if (ts) {if (channel.guild.channels.cache.has(ts) && channel.guild.channels.cache.get(ts).permissionsFor(client.user.id).has("SEND_MESSAGES")) { - channel.guild.channels.cache.get(ts).send(new Discord.MessageEmbed() - .setTitle("New Channel") - .setDescription(`<#${channel.id}> || **#${channel.name}**${channel.parent && channel.parent.name ? `\nCategory: **${channel.parent.name}**` : ''}`) - .setColor('936b30') - .setFooter("Natsuki", client.user.avatarURL()) - .setTimestamp() - ); - }} + if (channel.guild) { + let ts = client.guildconfig.logs.has(channel.guild.id) && client.guildconfig.logs.get(channel.guild.id).has('ch') ? client.guildconfig.logs.get(channel.guild.id).get('ch') : null; + if (ts) {if (channel.guild.channels.cache.has(ts) && channel.guild.channels.cache.get(ts).permissionsFor(client.user.id).has("SEND_MESSAGES")) { + channel.guild.channels.cache.get(ts).send(new Discord.MessageEmbed() + .setTitle("New Channel") + .setDescription(`<#${channel.id}> || **#${channel.name}**${channel.parent && channel.parent.name ? `\nCategory: **${channel.parent.name}**` : ''}`) + .setColor('936b30') + .setFooter("Natsuki", client.user.avatarURL()) + .setTimestamp() + ); + }} + } }; \ No newline at end of file