how i can make folder for actions example is: "MessageCreate", guildCreate etc.
how i can make folder for actions example is: "MessageCreate", guildCreate etc.
the same as with slash commands only with a larger scope of actions on the server and not with the user, but i dont know how to make this
7 Replies
- 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 OPSo your trying to make an event listener or what a folder for event listeners? Whats rhe question me confused
If I understand the question correctly, you want organize your events, such as
messageCreate
and guildCreate
, into their own folders/files within your project?
You would do that by exporting and importing your event files, but this technically isn't djs related, try #other-js-ts insteadEvent handler
If u make a folder with event handler files in for each event then u can give each object an event name and a run function
Cycle through each event and add each one using client.on(event.name, (...params) => event.run(...params))
Something like that should work
Covered extensively in the official guide linked above.