skick1234 / DisTube

A powerful Discord.js module for simplifying music commands and effortless playback of various sources with integrated audio filters.
https://distube.js.org
MIT License
422 stars 94 forks source link

error and searchNoResult events not working #307

Closed AlibiXVII closed 1 year ago

AlibiXVII commented 1 year ago

Please describe your problem in as much detail as possible:

Error and searchNoResult events aren't working on my bot. For example, if I play a private playlist my bot will give an error without sending any message in the channel and the bot stops. Other events work fine.

Further information:

skick1234 commented 1 year ago

error event only emits while the playing stream has an issue. searchNoResult is same as searchResult and other search events, Emitted when DisTubeOptions.searchSongs bigger than 0, and song param of DisTube#play is an invalid url, and has message option image searchNoResult is not work with interaction or #search

To handle those errors, use await try catch or .catch instead since they are Promises