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();