Skip to content

Commit

Permalink
[Fix] Added the error event to take a better look at the error messag…
Browse files Browse the repository at this point in the history
…es from the player
  • Loading branch information
naseif committed Sep 4, 2021
1 parent 4a81661 commit 520a815
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ for (const file of eventFiles) {

// Loop through the discord-player events and require them

const botEvents = fs
const playerEvents = fs
.readdirSync("./playerEvents")
.filter((file) => file.endsWith(".js"));

for (const file of botEvents) {
for (const file of playerEvents) {
const event = require(`./playerEvents/${file}`);
player.on(event.name, event.execute);
}
Expand Down
6 changes: 6 additions & 0 deletions playerEvents/error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
name: "error",
async execute(queue, error) {
console.log(`An error occured Here is the error message: ${error.message}`);
},
};

0 comments on commit 520a815

Please sign in to comment.