discord.js: dispatcher bug on Linux systems
Please describe the problem you are having in as much detail as possible:
so i when i try to call the playFile function to play a file the Dispatcher just immediately call the end event after the start also i get that error from the error event:
TypeError: Cannot read property 'key' of undefined
at StreamDispatcher.createPacket
(/root/node_modules/discord.js/src/client/voice/dispatcher/StreamDispatcher.js:154:97)
at StreamDispatcher.sendBuffer
(/root/node_modules/discord.js/src/client/voice/dispatcher/StreamDispatcher.js:122:25)
at StreamDispatcher.process
(/root/node_modules/discord.js/src/client/voice/dispatcher/StreamDispatcher.js:231:14)
at Socket.stream.once
(/root/node_modules/discord.js/src/client/voice/dispatcher/StreamDispatcher.js:312:12)
at Object.onceWrapper (events.js:293:19)
at emitNone (events.js:86:13)
at Socket.emit (events.js:188:7)
at emitReadable_ (_stream_readable.js:434:10)
at emitReadable (_stream_readable.js:428:7)
at readableAddChunk (_stream_readable.js:189:13)
i think its a bug from D.js or how D.js handle ffmpeg on a linux based system because the same code run with no problems on my windows computer but on my Linux based VPS it dont work also here is a basic view how my code look and all vars are defined(checked all double times) so maybe you know more (also i tried it on Ubuntu server 16.04 also and got the same problem)
Include a reproducible code sample here, if possible:
var voiceConnection = msg.guild.voiceConnection
const dispatcher = voiceConnection.playFile(`./audio_cache/xyz.mp3`, {"volume": 0.2})
dispatcher.on('start', () => {
msg.channel.send(`**Start playing: ${title} Requested by** ${author}`)
}
)
dispatcher.on('error', error => {
console.log(error)
}
)
dispatcher.on('end', () => {
msg.channel.send(`**Finished playing:** ${title}`)
}
)
Further details:
-
discord.js version: 11.1 Stable | 12.0 Master DEV
-
node.js version: 7.10
-
Operating system: Debian
-
Priority this issue should have – please be realistic and elaborate if possible: not as important
-
I have also tested the issue on latest master, commit hash: #1498
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 35 (33 by maintainers)
Can reproduce in a debian docker container with ffmpeg-static
Worked fine yesterday and without any changes this error popped up today
@aemino it works fine on my own Pc where i code and on a friends Windows root server(where i host atm) so im sure its because of that well the point with the consistense is problematic couz only i and a few others have that bug but i could give you acess to my VPS where a basic script what shows the problem is there and the bug is consistently around also pls let me now if that is okay for you