I am trying to make my bot work, yet again.
This is my play function.
function play(connection, message) {
var server = servers[message.guild.id];
server.dispatcher = connection.play(
ytdl(server.queue[0], { filter: "audioonly" })
);
server.queue.shift();
server.dispatcher.on("end", function() {
if (server.queue[0]) {
play(connection, message);
} else {
connection.disconnect();
}
});
}
and it does play.
if (!message.guild.voiceConnection)
message.member.voice.channel.join().then(function(connection) {
message.channel.send("Playing tune now, Enjoy!");
play(connection, message);
console.log("Playing tune now!");
});
I get my log that it's playing and after a few seconds or so I get an error message
TypeError: Cannot convert "null" to int
TypeError: Cannot convert "null" to int
and something here
discord-music-bot\node_modules\opusscript\build\opusscript_native_wasm.js:8 (TypeError: Cannot convert "null" to int)
Other scripts that are also mentioned in the discord.js documentation I can't install and I have tried everything I could think of.
As sugessted on this github thread you should try using @discordjs/opus
or node-opus
instead of opusscript
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With