Please describe the problem you are having in as much detail as possible:
After updating discord.js to version 12, when bot try to join into the voice channel, the code throws the error "cannot convert null to 'int'" in opusscript. I checked it works properly on @discordjs/opus, but it doesn't sounds clear.
Include a reproducible code sample here, if possible:
let commandJoin = {
cmd: /\bjoin\b|\bj\b/i,
async exec(_client, msg, _param) {
let voiceChannel = msg.member.voice.channel;
if (msg.guild.me.voice.channel) {
if (msg.guild.me.voice.channel.equals(voiceChannel)) {
await send(msg.channel, new Discord.MessageEmbed()
.setTitle(':notes: Already joined!')
);
} else {
await voiceChannel.join();
}
} else {
await voiceChannel.join();
}
}
};
Further details:
I got the same error. On node 10 and on 12.
I checked it works properly on @discordjs/opus, but it doesn't sounds clear.
This makes no sense at all and is only placebo. opusscript and @discordjs/opus use the identical opus version, which means there can not be a degrade in audio quality.
Just to supply more details on the issue, The null to int conversion error is only thrown when attempting to play an audio like I did with the following.
msg.member.voice.channel.join().then((c)=>c.play(`http://www.hochmuth.com/mp3/Bloch_Prayer.mp3`))
The exact error that is thrown is
! TypeError: Cannot convert "null" to int
✓ TypeError: Cannot convert "null" to int
TypeError: Cannot convert "null" to int
! abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1 for more info.
/opt/rookiebotelite/node_modules/opusscript/build/opusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]
abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1 for more info.
Also when I install @discordjs/opus I do not experience any degraded performance with audio as far as I am aware.
Node version: v13.01
Discord.js version: master branch, v12.0.2
OS: Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)
Opusscript version: 0.0.7
I have the same problem but with opusscript 0.0.7 on Node v12.15.0 on Debian with discord.js 12.0.2, but with @discord.js/opus no. With @discord.js/opus music on Linux freezes, but on Windows no
Did you find a solution? I am having the same problem, and I can not install @discrodjs/opus or node-opus for some reason
Same error here, is there a fix? I haven't found anything..
TypeError: Cannot convert "null" to int
TypeError: Cannot convert "null" to int
D:\Documentsz\DISCORD BOT\node_modulesopusscript\buildopusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versioVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locate
abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1 for more info.
Try using node-opus instead of opusscript or @discordjs/opus, I
used @discordjs/opus and it's working for me.
Make sure to look at the documentations od discord.js because the tutorials
on youtube are outdated.
On Thu, Mar 26, 2020 at 2:39 PM Impalez notifications@github.com wrote:
Same error here, is there a fix? I haven't found anything..
TypeError: Cannot convert "null" to int
TypeError: Cannot convert "null" to intD:\Documentsz\DISCORD
BOT\node_modulesopusscript\buildopusscript_native_wasm.js:8
var Module=typeof Module!=="undefined"?Module:{};var
moduleOverrides={};var key;for(key in
Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw
toThrow};Module["preRun"]=[];Module["postRun"]=[];var
ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var
ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var
ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof
window==="object";ENVIRONMENT_IS_WORKER=typeof
importScripts==="function";ENVIRONMENT_HAS_NODE=typeof
process==="object"&&typeof process.versions==="object"&&typeof
process.versioVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var
scriptDirectory="";function locateFile(path){if(Module["locate
abort(TypeError: Cannot convert "null" to int). Build with -s ASSERTIONS=1
for more info.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/discordjs/discord.js/issues/3895#issuecomment-604436365,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIS5CS36JW6QFHKZFG5VHJLRJNLIPANCNFSM4LBH565A
.
Its working with @discordjs/opus !! Thank you very very much.
@discordjs/opus works. Thank you guys! 😃
@superVoja
Thank you OMG thank you so so so so so so so much!!!! for the @discord/opus command my day is made!
I cannot install @discordjs/opus nor node-opus.
I cannot install @discordjs/opus nor node-opus.
Sorry to hear that, you might be typing in wrong, try npm install - - save @discordjs/opus make sure you have downloaded discord.js and npm init(I’m sure you have) if you need more help just comment back! Best of luck
"npm install - - save @discordjs/opus" didn't work for me.
Hmm... what kinda error are you getting? Like will it download and the program just isn’t working that may help?
Please do not comment on old closed issues.
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.
Most helpful comment
Try using node-opus instead of opusscript or @discordjs/opus, I
used @discordjs/opus and it's working for me.
Make sure to look at the documentations od discord.js because the tutorials
on youtube are outdated.
On Thu, Mar 26, 2020 at 2:39 PM Impalez notifications@github.com wrote: