Code structure question

Hello, maybe that's an stupid question, but I never did use it. I try to handle my code way better then only an "index.js", so I decided to split the code into more "~.js"-s. So my question is: can I do more then one file with "ready" or "interactionCreate"?
6 Replies
d.js docs
d.js docs2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Kilian
Kilian2y ago
So like I do an folder named "events" into this folder I put multiple files like: "poll.js", "register.js" ... etc. I hope you understand me and my little issue.
monbrey
monbrey2y ago
you can, but you generally dont want to duplicate your events Rather you'd want one interactionCreate.js event file handling and routing to multiple command files
d.js docs
d.js docs2y ago
guide Creating Your Bot: Dynamically executing commands read more
monbrey
monbrey2y ago
I think this part of the guide gets into file splitting
Kilian
Kilian2y ago
hm okay make sence Yes it is, but my question pointed at another way :D