[6.1.0 indev] Crashing when user leaves then joins voice channel on server while playing audio file
See original GitHub issueBot crashing when a user leaves then joins any voice channel on server while bot is playing a audio file.
Error:
C:\Users\USER\Desktop\BotBot\indev\node_modules\discord.js\lib\Client\InternalClient.js:2088
if (connection.voiceChannel.id !== data.channel_id) {
^
TypeError: Cannot read property 'id' of null
at WebSocket.websocket.onmessage (C:\Users\USER\Desktop\BotBot\indev\node_modules\discord.js\lib\Client\InternalClient.js:2088:34)
at WebSocket.onMessage (C:\Users\USER\Desktop\BotBot\indev\node_modules\ws\lib\WebSocket.js:418:14)
at emitTwo (events.js:105:20)
at WebSocket.emit (events.js:185:7)
at Receiver.ontext (C:\Users\USER\Desktop\BotBot\indev\node_modules\ws\lib\WebSocket.js:816:10)
at C:\Users\USER\Desktop\BotBot\indev\node_modules\ws\lib\Receiver.js:477:18
at Receiver.applyExtensions (C:\Users\USER\Desktop\BotBot\indev\node_modules\ws\lib\Receiver.js:364:5)
at C:\Users\USER\Desktop\BotBot\indev\node_modules\ws\lib\Receiver.js:466:14
at Receiver.flush (C:\Users\USER\Desktop\BotBot\indev\node_modules\ws\lib\Receiver.js:340:3)
at Receiver.opcodes.1.finish (C:\Users\USER\Desktop\BotBot\indev\node_modules\ws\lib\Receiver.js:482:12)
My Code
var discord = require('discord.js');
var bot = new discord.Client();
bot.login(EMAIL, PASSWORD);
bot.on('message', function(message) {
if (message.content === "play") {
bot.joinVoiceChannel(message.author.voiceChannel, function() {
bot.voiceConnection.playFile(__dirname+'/test.mp3', {
volume: 0.75
}, function(error, intent) {
intent.on('end', function() {
bot.leaveVoiceChannel();
});
})
})
}
});
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Voice channels stop working. Crashes Windows Audio Service
Sometimes, this will crash Windows Audio Service, and I lose all sound (opening volume options gives a dialog to restart). I've tried changing...
Read more >Crashing upon joining voice channels - Discord Support
I'm running discord on a 2010 MacBook (MacOS 10.13) and discord has been running ... however, when I join a voice channel/private call...
Read more >Untitled
Love from in french translation, Bill scott voice actor, Levada forrozeira, ... college music courses, Leaf and flower crafts, Start point devon postcode!...
Read more >MalisisAdvert 1.12.6.1.0 / 1.11.2-5.1.0 (01/02/2018)
Running latest MalisisAdvert on Cauldron 1.1307.06.218 with latest Forge but server crashes with exeption in server tick loop after Advert block ...
Read more >Untitled
Samsung sch-r900, Break edge symbol, Seacell ringtones, Kevin menck palette, Index defrag script sql server, Kamla singh yadav, 2p12g1, Manna dey classical ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
/tableflip
bugs are liferino 💯