distubejs / example

An easy to use and customize discord music bot. Support YouTube, Spotify, SoundCloud, and 700+ more sites
https://distube.js.org
MIT License
149 stars 72 forks source link

Bot Crashes when leaving with a large queue #14

Closed groent closed 5 months ago

groent commented 2 years ago

Not sure if this is a problem with my code or with Distube.

 TypeError [PlayingError]: Cannot destructure property 'duration' of 'queue.songs[0]' as it is undefined.
    at DisTubeHandler.createStream (/home/pi/Desktop/bot/botName/node_modules/distube/dist/core/DisTubeHandler.js:328:17)
    at QueueManager.playSong (/home/pi/Desktop/bot/botName/node_modules/distube/dist/core/manager/QueueManager.js:83:41)    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async QueueManager.create (/home/pi/Desktop/bot/botName/node_modules/distube/dist/core/manager/QueueManager.js:45:25)
    at async SpotifyPlugin.play (/home/pi/Desktop/bot/botName/node_modules/@distube/spotify/dist/index.js:178:32)
/home/pi/Desktop/bot/botName/main.js:43
  channel.send(`An error encoutered: ${error.slice(0, 1979)}`) // Discord limits 2000 characters in a message
                                             ^

TypeError: error.slice is not a function
    at DisTube.<anonymous> (/home/pi/Desktop/bot/botName/main.js:43:46)
    at DisTube.emit (node:events:527:28)
    at DisTube.emitError (/home/pi/Desktop/bot/botName/node_modules/distube/dist/DisTube.js:703:18)
    at QueueManager.emitError (/home/pi/Desktop/bot/botName/node_modules/distube/dist/core/DisTubeBase.js:31:22)
    at QueueManager._QueueManager_handlePlayingError (/home/pi/Desktop/bot/botName/node_modules/distube/dist/core/manager/QueueManager.js:178:10)
    at QueueManager.playSong (/home/pi/Desktop/bot/botName/node_modules/distube/dist/core/manager/QueueManager.js:93:106)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async QueueManager.create (/home/pi/Desktop/bot/botName/node_modules/distube/dist/core/manager/QueueManager.js:45:25)
    at async SpotifyPlugin.play (/home/pi/Desktop/bot/botName/node_modules/@distube/spotify/dist/index.js:178:32)
pryzmian commented 2 years ago

Its your code, and this is an example code, so yeah