fix error on error lol

This commit is contained in:
JonnyBro 2021-12-26 14:12:16 +05:00
parent 7497da78b0
commit e3cc5cfa80

View file

@ -74,18 +74,11 @@ class JaBa extends Client {
}) })
.on("searchDone", () => {}) .on("searchDone", () => {})
.on("searchCancel", message => message.error("misc:TIMES_UP")) .on("searchCancel", message => message.error("misc:TIMES_UP"))
.on("searchInvalidAnswer", message => { .on("searchInvalidAnswer", message => message.error("misc:INVALID_NUMBER_RANGE", { min: 1, max: tracks.length }))
if (message.content === "cancel") {
collector.stop();
return message.success("music/play:RESULTS_CANCEL");
};
message.error("misc:INVALID_NUMBER_RANGE", { min: 1, max: tracks.length });
})
.on("searchNoResult", message => message.error("music/play:NO_RESULT")) .on("searchNoResult", message => message.error("music/play:NO_RESULT"))
.on("error", (textChannel, e) => { .on("error", (textChannel, e) => {
console.error(e); console.error(e);
textChannel.send(this.translate("music/play:ERR_OCCURRED", { error: e.slice(0, 1900)})); textChannel.send(this.translate("music/play:ERR_OCCURRED", { error: e }));
}) })
.on("finish", queue => queue.textChannel.send(this.translate("music/play:QUEUE_ENDED"))) .on("finish", queue => queue.textChannel.send(this.translate("music/play:QUEUE_ENDED")))
.on("disconnect", queue => queue.textChannel.send(this.translate("music/play:STOP_DISCONNECTED"))) .on("disconnect", queue => queue.textChannel.send(this.translate("music/play:STOP_DISCONNECTED")))