From bfbd4a4b0b649ddf6ac0a3136f7cc272fdfdb41d Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 4 May 2021 14:10:52 -0700 Subject: [PATCH] fix 17 text channel confusion and remove logging --- bin/commands.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/commands.js b/bin/commands.js index f38c9ea..6cc23ba 100644 --- a/bin/commands.js +++ b/bin/commands.js @@ -7,10 +7,11 @@ const createNewChunk = () => { exports.enter = function(msg, channelName) { channelName = channelName.toLowerCase(); - msg.guild.channels.cache.forEach(c => { - console.log(c); - }) - const voiceChannel = msg.guild.channels.cache.find(channel => channel.name.toLowerCase() === channelName); + + //filter out all channels that aren't voice or stage + const voiceChannel = msg.guild.channels.cache + .filter(c => c.type === "voice" || c.type === "stage") + .find(channel => channel.name.toLowerCase() === channelName); //if there is no voice channel at all or the channel is not voice or stage if (!voiceChannel || (voiceChannel.type !== 'voice' && voiceChannel.type !== 'stage'))