From 397d7c7f3021f800ed0cafef56b800aac91c7a12 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Sun, 13 Jun 2021 22:37:37 +0545 Subject: [PATCH] update example bot --- example/index.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/example/index.ts b/example/index.ts index 721ede0..80f5a42 100644 --- a/example/index.ts +++ b/example/index.ts @@ -23,6 +23,10 @@ client.on("warn", console.warn); const player = new Player(client); player.on("error", console.error); +player.on("debug", (queue, message) => { + console.log(`DEBUG :: ${queue.guild.name}`); + console.log(message); +}); player.on("trackStart", (queue, track) => { const guildQueue = queue as Queue; @@ -34,6 +38,16 @@ player.on("trackAdd", (queue, track) => { guildQueue.metadata.send(`🎶 | Track **${track.title}** queued!`); }); +player.on("botDisconnect", (queue) => { + const guildQueue = queue as Queue; + guildQueue.metadata.send("❌ | I was manually disconnected from the voice channel, clearing queue!"); +}); + +player.on("channelEmpty", (queue) => { + const guildQueue = queue as Queue; + guildQueue.metadata.send("❌ | Nobody is in the voice channel, leaving..."); +}); + client.on("message", async (message) => { if (message.author.bot || !message.guild) return; if (!client.application?.owner) await client.application?.fetch();