Closed JubJub623D closed 6 years ago
All id's in discord must be used as string in javascript you need to call it like bot.joinVoiceChannel('your id',....
The issue is, in your example you give the id 468158477064470549 but because of integer precision d.io sees 468158477064470500, which probably isn't a valid ID
Thank you!
When the bot is running and the part of the code that uses bot.joinVoiceChannel is called, it returns this error message:
Error: Cannot find the server related to the channel provided: 468158477064470500 at handleErrCB (C:\Users\HKim\node_modules\discord.io\lib\index.js:1394:25) at DiscordClient.DCP.joinVoiceChannel (C:\Users\HKim\node_modules\discord.io\lib\index.js:1327:24) at DiscordClient.<anonymous> (C:\Users\HKim\bot\bot.js:184:22) at emitMany (events.js:147:13) at DiscordClient.emit (events.js:224:7) at DiscordClient.handleWSMessage (C:\Users\HKim\node_modules\discord.io\lib\index.js:1848:11) at emitTwo (events.js:126:13) at WebSocket.emit (events.js:214:7) at Receiver.ontext (C:\Users\HKim\node_modules\ws\lib\WebSocket.js:841:10) at C:\Users\HKim\node_modules\ws\lib\Receiver.js:536:18
This is the code that's throwing the error:
bot.joinVoiceChannel(468158477064470549, function(error, events) { if (error) return console.error(error); bot.getAudioContext(468158477064470549, function(error, stream) { if (error) return console.error(error); fs.createReadStream('Wonderwall.mp3').pipe(stream); stream.on('done', function() { bot.leaveVoiceChannel(468158477064470549, function(error, events){}); }); }); });;
EDIT: Also, how can I fix the formatting on this post?