update example bot
This commit is contained in:
parent
a43df93abe
commit
397d7c7f30
1 changed files with 14 additions and 0 deletions
|
@ -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<TextChannel>;
|
||||
|
@ -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<TextChannel>;
|
||||
guildQueue.metadata.send("❌ | I was manually disconnected from the voice channel, clearing queue!");
|
||||
});
|
||||
|
||||
player.on("channelEmpty", (queue) => {
|
||||
const guildQueue = queue as Queue<TextChannel>;
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue