Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Check if a user joins, leaves, or moves channels discord.js

client.on('voiceStateUpdate', (oldState, newState) => {
    if(oldState.channelID === newState.channelID) {
        console.log('a user has not moved!')
    }
    if(oldState.channelID != null && newState.channelID != null && newState.channelID != oldState.channelID) {
        console.log('a user switched channels')
    }
    if(oldState.channelID === null) {
        console.log('a user joined!')
    }
    if (newState.channelID === null) {
        console.log('a user left!')
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Check #user #moves #channels
ADD COMMENT
Topic
Name
4+1 =