From a729545e01bcbb484e66cbb14c8c55f11749e636 Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Sun, 12 Nov 2023 11:01:07 -0500 Subject: [PATCH] Fixing comparison states --- breadbot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/breadbot.js b/breadbot.js index ebfd707..8b9c66d 100644 --- a/breadbot.js +++ b/breadbot.js @@ -81,9 +81,9 @@ client.on(Events.GuildCreate, async guild => { }) client.on(Events.VoiceStateUpdate, async (oldState, newState) => { - if (oldState.channel.name == null && newState.channel.name != null) { + if (oldState.channel== null && newState.channel != null) { console.log(`User ${newState.member.username} joined channel ${newState.channel.name} in guild ${newState.guild.name}`) - } else if (oldState.channel.name != null && newState.channel.name == null) { + } else if (oldState.channel != null && newState.channel == null) { console.log(`User ${oldState.member.username} left channel ${oldState.channel.name} in guild ${oldState.guild.name}`) } })