discord.js: Opusscript Error: cannot convert "null" to int

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:

  • discord.js version: 12.0.1
  • Node.js version: 12.16.1
  • Operating system: Windows 10
  • Priority this issue should have – please be realistic and elaborate if possible:
  • I have also tested the issue on latest master, commit hash:

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

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 int

D:\Documentsz\DISCORD BOT\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.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 .