discordjs join voice channel code example
Example 1: discord.js join voice channel
if(!message.member.voice.channel) return message.channel.send("Please connect to a voice channel!"); //If you are not in the voice channel, then return a message
message.member.voice.channel.join(); //Join the voice channel
Example 2: recieve voice channel audio discord.js
const audio = connectionA.receiver.createStream('User ID');
connectionB.play(audio, { type: 'opus' });