[Moved]

It's as the title says. I've been trying to solve this problem for hours and I just don't understand it.
5 Replies
d.js toolkit
d.js toolkit4w 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 staff
N/A
N/AOP4w ago
So, this is my code so far I use this to load all of my events
// Load events
const eventFiles = Deno.readDirSync("./events");
for (const file of eventFiles) {
const event = await import(`./events/${file.name}`);
const module: Event<any> = event.default;

if (module.once) {
client.once(module.name, (...args) => module.execute(...args));
} else {
client.on(module.name, (...args) => module.execute(...args));
}
console.log(`Loaded event: '${module.name}'`);
}
// Load events
const eventFiles = Deno.readDirSync("./events");
for (const file of eventFiles) {
const event = await import(`./events/${file.name}`);
const module: Event<any> = event.default;

if (module.once) {
client.once(module.name, (...args) => module.execute(...args));
} else {
client.on(module.name, (...args) => module.execute(...args));
}
console.log(`Loaded event: '${module.name}'`);
}
And, when it tries to load "MessageCreate.ts", it completely stops. For reference, all the other file (MessageCreate.ts) does, is try to print Commands via console.log(); , and this is how I import said Commands map.
import { Commands } from "../main.ts"; // Import the Commands map
import { Commands } from "../main.ts"; // Import the Commands map
I'm literally not doing anything else except trying to log "Commands" too, which is really confusing. I've discovered that it works if I put this program in a function and then run it but I don't know why
N/A
N/AOP4w ago
This is the output by the way.
No description
Amgelo
Amgelo4w ago
this isn't djs related, use #other-js-ts move the question there and share what is on MessageCreate.ts
N/A
N/AOP4w ago
👎
Want results from more Discord servers?
Add your server