Any1 knows why i might be getting this error ?

Code and error in the chat
5 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Dex
DexOP2mo ago
No description
Dex
DexOP2mo ago
No description
Dex
DexOP2mo ago
export default function loadEvents(client: any) {
const ascii = require("ascii-table");
const fs = require("fs");
const table = new ascii().setHeading("Events", "Status");
const folders = fs.readdirSync("./src/Events");

for (const folder of folders) {
const files = fs
.readdirSync(`../Events/${folder}`)
.filter((file: any) => file.endsWith(".js"));

for (const file of files) {
const event = require(`../Events/${folder}/${file}`);
if (event.rest) {
if (event.once) {
client.rest.once(event.name, (...args: any) =>
event.execute(...args, client)
);
} else {
client.rest.on(event.name, (...args: any) =>
event.execute(...args, client)
);
}
} else {
if (event.once) {
client.once(event.name, (...args: any) => event.execute(...args, client));
} else {
client.on(event.name, (...args: any) => event.execute(...args, client));
}
}
table.addRow(file, "loaded");
continue;
}
}
return console.log(table.toString(), "\nLoaded events");
}
export default function loadEvents(client: any) {
const ascii = require("ascii-table");
const fs = require("fs");
const table = new ascii().setHeading("Events", "Status");
const folders = fs.readdirSync("./src/Events");

for (const folder of folders) {
const files = fs
.readdirSync(`../Events/${folder}`)
.filter((file: any) => file.endsWith(".js"));

for (const file of files) {
const event = require(`../Events/${folder}/${file}`);
if (event.rest) {
if (event.once) {
client.rest.once(event.name, (...args: any) =>
event.execute(...args, client)
);
} else {
client.rest.on(event.name, (...args: any) =>
event.execute(...args, client)
);
}
} else {
if (event.once) {
client.once(event.name, (...args: any) => event.execute(...args, client));
} else {
client.on(event.name, (...args: any) => event.execute(...args, client));
}
}
table.addRow(file, "loaded");
continue;
}
}
return console.log(table.toString(), "\nLoaded events");
}
monbrey
monbrey2mo ago
An issue with the paths youre trying to load, not related to discord.js
Want results from more Discord servers?
Add your server