Get existing connection with endpoint, token and session

Hello! I am currently working on a music bot which will have voice recognition capability i've gotten the music part to work (i use lavalink-client) and i've also gotten the voice recognition to work. Now my issue is, is having both work together. When a user does /play it establishes a connection through lavalink-client and lavalink-client doesn't give full voice connection data except endpoint, token and session so I was wondering how can i essentially tap in to that connection using those 3 parameters'? I need access to connection.receiver for the voice recognition system.
2 Replies
d.js toolkit
d.js toolkit14mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
steven
stevenOP14mo ago
[email protected] C:\Users\clap\Desktop\gr$pe v3

`node -v v18.17.0
[email protected] C:\Users\clap\Desktop\gr$pe v3

`node -v v18.17.0
const connection = joinVoiceChannel({
guildId: interaction.guild.id,
channelId: channel.id,
adapterCreator: interaction.guild.voiceAdapterCreator
})

const player = client.lavalink.createPlayer({
guildId: interaction.guildId,
voiceChannelId: channel.id,
textChannelId: interaction.channelId,
selfDeaf: false,
selfMute: false,
volume: 40
})

await player.connect()

console.log(connection.receiver)

connection.receiver.speaking.on('start', (id) => {
console.log(id)
})
const connection = joinVoiceChannel({
guildId: interaction.guild.id,
channelId: channel.id,
adapterCreator: interaction.guild.voiceAdapterCreator
})

const player = client.lavalink.createPlayer({
guildId: interaction.guildId,
voiceChannelId: channel.id,
textChannelId: interaction.channelId,
selfDeaf: false,
selfMute: false,
volume: 40
})

await player.connect()

console.log(connection.receiver)

connection.receiver.speaking.on('start', (id) => {
console.log(id)
})
both of them say they are working, lavalink says it’s connected and playing music while receiver says it’s signaling but both of them aren’t working but it does join the vc :/ so how can i get them to work together? the creator of lavalink-client said he did something similar in discord.jsv13 in the past and he used something like that and he suggested it to me also i brought up what i mentioned here and he said “U need opus, encoders and smt else too” so how can it be done? it seems possible he also said the same thing, to come here so no possible way of doing this?
Want results from more Discord servers?
Add your server