#Here s a snippet of what I do
1 messages · Page 1 of 1 (latest)
Sorry to ask dumb questions, just wanna get them outta the way:
-
Are you uber super positive that the joinVoiceChannel command is being called? ie, are you sure the
if(lowerCaseMessage === 'join')branch is being followed? -
Have you
console.log()'d the id used injoinVoiceChannel, and the id used for when you callgetVoiceConnection, to double triple check that they're the same ID? -
Where are you calling getVoiceConnection? From within the lambda, right after joinVoiceChannel, or elsewhere outside of the
messageCreatecallback?
Also, have you tried doing const vc = joinVoiceChannel({...}) and seeing if the voiceConnection that joinVoiceChannel itself should be returning is valid?
Thanks for helping btw.
So I just found that it works if I call it from my index file, but it does not work when used in a specific node module file.
I want to use discord speech recognition but this line fails to get the voice connection instance. This issue might be out of the scope of the discordjs server, but it still does confuse me why I'm not able to get the instance in that file, even if I manually use the guild id in a setInterval
Extension for making discord speech recognition bots.. Latest version: 3.3.1, last published: a month ago. Start using discord-speech-recognition in your project by running npm i discord-speech-recognition. There are no other projects in the npm registry using discord-speech-recognition.
if you haven't already, I'd still double check that the id you're using in the setInterval (the one where getVoiceConnection isn't working) is prim and proper for the sake of sanity
It is correct. Just really odd that the function works in my index file but not in the node modules file.
what is voice_1?
const voice_1 = require("@discordjs/voice");
It's in a node_modules file. I was debugging why the speech recognition package wasnt working. I narrowed it down to this issue. Didn't see any issues about this in the github page either
I actually got it. I removed "type": "module", from my package.json and used require instead of import syntax and now it works. So odd. Not sure what piece of software is at fault
Ah, that's a much better explanation than the conspiracy theories I was coming up with
I wonder if the node_modules package was using it's own, local copy of @discordjs/voice, and something was going screwy between that, and your top level @discordjs/voice