Closed shikhir-arora closed 5 years ago
Having just sodium
doesn't fix the error with discord.js 11.3 -- it fixes the instant join/leave -> recreate, but the minute any packets come through it throws the same error (so if everyone is muted sodium
works, otherwise it crashes).
Using discord.js 12.0-dev is completely refactored from the VoiceReceiver
which has been rewritten (presumably to use their prism library). The bot joins and can receive packets fine, but methods like VoiceReceiver#destroy
don't exist at all as it's been refactored.
Since I noticed this issue was fixed in the 12.0-dev branch by updating the wrappers (see here) - I was able to fix this error by using the later (>=0.7.0) libsodium-wrappers
with the discord.js library. In node_modules
the libsodium-wrappers
should be at version >=0.7.0 as they are on the discord.js 12.0-dev build.
This combination fixes the crash and allows the bot to function normally (/podon
and /podoff
).
Good catch, I was messing about trying to decide which sodium dep to use and guess I inadvertently settled for neither...
Anyway, excuse my ignorance, but is 12.0-dev the master branch for discord.js? Also, do you need both sodium and libsodium-wrappers? I thought it was one or the other, where sodium has better performance.
Other than that, I tried using latest version of one of them but had problems (which the update you linked looks like it should fix) and a bit of investigating suggested that an earlier version was required for things to work.
I can't see the fix that would enable 0.7.3 of libsodium-wrappers to work on the 11.3-dev branch. If I were to guess, I'd say that since you have both sodium and libsodium-wrappers installed, sodium takes priority so the issue with libsodium-wrappers doesn't occur despite the lack of fix?
That may be it, I did end up building sodium from source. But even 11.3 has libsodium-wrappers
and sodium
(just an earlier version of wrappers) - so I can't see it hurting here.
Yeah, 12.0-dev is master. They have not finished rewriting the AudioReceiver
yet, so that is not functional.
Were you able to see anything further?
Sorry man, I wanted to just test it to see what works what doesn't but sodium stopped compiling without error and I haven't had the time to go through it all yet.
Not a problem 👍
Yeah in hindsight I never got around to finishing this up. Anyway, sodium dependency has been updated and the API for setActivity has changed again (I ran out of time tonight so that line is just commented out on master right now, I'll fix it tomorrow)
sodium
dependency; it was removed by accident in the rewrite. Fixes error: EDIT: See next post as well.setGame
tosetActivity
to fix depreciation warning. Fixes:🙂