I find just writing out the steps in comments then implementing the comments helps
//First we need to get the users voice state
//check if they are in a group or team channel
//if they’ve opted out of auto-connect for voice then don’t connect them to the voice channel
//etc
//First we need to get the users voice state //check if they are in a group or team channel //if they’ve opted out of auto-connect for voice then don’t connect them to the voice channel //etc