Fixing comparison states

This commit is contained in:
Bradley Bickford 2023-11-12 11:01:07 -05:00
parent 7e79b2c3b4
commit a729545e01

View File

@ -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}`)
}
})