Please describe the problem you are having in as much detail as possible:
After joining (connection.join()) VoiceChannel, bot crashes with this issue
TypeError: Right-hand side of 'instanceof' is not callable
at VoiceConnection.play (C:\Users\Administrator\Desktop\bot\node_modules\discord.js\src\client\voice\util\PlayInterface.js:63:18)
at VoiceConnection.onSessionDescription (C:\Users\Administrator\Desktop\bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:471:31)
at VoiceWebSocket.emit (events.js:311:20)
at VoiceWebSocket.onPacket (C:\Users\Administrator\Desktop\bot\node_modules\discord.js\src\client\voice\networking\VoiceWebSocket.js:189:14)
at VoiceWebSocket.onMessage (C:\Users\Administrator\Desktop\bot\node_modules\discord.js\src\client\voice\networking\VoiceWebSocket.js:140:19)
at WebSocket.onMessage (C:\Users\Administrator\Desktop\bot\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:311:20)
at Receiver.receiverOnMessage (C:\Users\Administrator\Desktop\bot\node_modules\ws\lib\websocket.js:800:20)
at Receiver.emit (events.js:311:20)
at Receiver.dataMessage (C:\Users\Administrator\Desktop\bot\node_modules\ws\lib\receiver.js:423:14)
Include a reproducible code sample here, if possible:
const Discord = require('discord.js');
const client = new Discord.Client({autoReconnect:true});
client.on("message", msg => {
if (msg.content === '!connect') {
if (msg.member.voice.channel) {
msg.member.voice.channel.join()
.then(connection => {
msg.channel.send('Connected');
connection.on("speaking", (user, speaking) => {
if (speaking.bitfield > 0) {
dispatcher = connection.play('1.mp3');
}
});
})
.catch(console.log);
}
}
});
client.login('token');
Further details:
Priority this issue should have: Middle
[x] I have also tested the issue on latest master, commit hash: 8a2f8938be35e70f87ad99b3860116526e8622e6
If you need help with discord.js installation or usage, please go to the discord.js Discord server instead:
https://discord.gg/bRCvFy9
This issue tracker is only for bug reports and enhancement suggestions.
You won't receive any basic help here.
EDIT: mistakes were made, sorry.
I'm getting the same error after updating to the latest commits. Trying to do some troubleshooting now.
Thank you!