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)
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: