From f5f3108cd6aeb2556b711fcd14642d490fbfdd2c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 18 Sep 2024 17:22:06 +0200 Subject: [PATCH] add player error --- src/events/loader.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/events/loader.ts b/src/events/loader.ts index e379e88..6aa2ec8 100644 --- a/src/events/loader.ts +++ b/src/events/loader.ts @@ -19,6 +19,18 @@ export default async (client: Client, isDev: boolean) => { }); } + player.events.on("error", (_, error) => { + // Emitted when the player queue encounters error + console.error(`General player error event: ${error.message}`); + console.error(error); + }); + + player.events.on("playerError", (_, error) => { + // Emitted when the audio player errors while streaming audio track + console.error(`Player error event: ${error.message}`); + console.error(error); + }); + events_categories.forEach(async (event_category) => { // Retrieve events const events = await readdir(`${__dirname}/${event_category}`);