How can I get a voice connection object from an interaction object?
Pretty straight forward question in the title,
I set up my Bot as per the structure in the docs with the separate 'event', 'command' folders, I have created a new command called join which makes the bot join the channel, and also houses the "joinVoiceChannel" object. But in a separate command of 'play' I'm not sure how I can get the 'voice connection' object in it so that I can create an audio stream?
4 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
discordjs/voice has a getVoiceConnection method that you can use
getVoiceConnection
Finds a voice connection with the given guild id and group. Defaults to the 'default' group.
Thanks I’m dumb and didn’t realize I could change the docs at the top to voice, I was searching all through the default discordjs docs