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
d.js toolkit
d.js toolkit14mo 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
DuckXYZ
DuckXYZ14mo ago
So your trying to make an event listener or what a folder for event listeners? Whats rhe question me confused
zevnda
zevnda14mo ago
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 instead
ayman
ayman14mo ago
Event handler
DuckXYZ
DuckXYZ14mo ago
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
d.js docs
d.js docs14mo ago
guide Creating Your Bot: Event handling - Individual event files read more
SpecialSauce
SpecialSauce14mo ago
Covered extensively in the official guide linked above.
Want results from more Discord servers?
Add your server