This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.js
40 lines (33 loc) · 1.47 KB
/
events.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module.exports.registerPlayerEvents = (player) => {
player.on("error", (queue, error) => {
console.log(`[${queue.guild.name}] Error emitted from the queue: ${error.message}`);
queue.metadata.send(`❗ | There was an error playing that song, please try again.`);
});
player.on("connectionError", (queue, error) => {
console.log(`[${queue.guild.name}] Error emitted from the connection: ${error.message}`);
queue.metadata.send(`❗ | There was an error playing that song, please try again.`);
});
player.on("trackStart", (queue, track) => {
queue.metadata.send(`🎶 | Started playing: **${track.title}** in **${queue.connection.channel.name}**!`);
});
player.on("trackAdd", (queue, track) => {
queue.metadata.send(`🎶 | Track **${track.title}** queued!\n:warning: Tunez is reaching end of life, learn more at <https://tunez.ml/eol>`);
});
player.on("botDisconnect", (queue) => {
try {
queue.metadata.send("❌ | I was manually disconnected from the voice channel, clearing queue!");
} catch (error) {
console.error(error)
}
});
player.on("channelEmpty", (queue) => {
try {
queue.metadata.send("❌ | Nobody is in the voice channel, leaving...");
} catch (error) {
console.error(error)
}
});
player.on("queueEnd", (queue) => {
queue.metadata.send("✅ | Queue finished!");
});
};