Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event Handling #2

Closed
DJ45X opened this issue Dec 1, 2022 · 3 comments
Closed

Event Handling #2

DJ45X opened this issue Dec 1, 2022 · 3 comments

Comments

@DJ45X
Copy link

DJ45X commented Dec 1, 2022

In regards to this,

I'd rather not have my events in the index.js. Is there a way, through DKRCommands, to move my event code into a separate file/ folder? I liked how WOKCommands used to have a Features directory where I could store my event listeners. Helped a lot with file/ folder organization and keeping the index.js lean.

Else, I'm open to any ideas you may have :)

@karelkryda
Copy link
Member

Hello,
I have currently published version 1.0.0-beta.3, which allows to load events from a separate folder with the following hierarchy:

> events
  > messageCreate
    > eventFile1.ts/.js
    > eventFile2.ts/.js
    > ...
  > messageDelete
    > eventFile1.ts/.js
    > eventFile2.ts/.js
    > ...

events = events folder
messageCreate/Delete = event folder - must have correct name
each folder can have any number of files (when a given event is called, all of them are triggered)


I'll also update the documentation to reflect these changes in a few minutes.
I'll ask you to test and report any problems 🙂.

Have a nice Friday afternoon


P.S. DKRCommands now use DJS v14.7.1 😉

@karelkryda
Copy link
Member

📖 Documentation updated: https://karel-kryda.gitbook.io/dkrcommands/useful-information/discord.js-events

@DJ45X
Copy link
Author

DJ45X commented Dec 2, 2022

Hello, I have currently published version 1.0.0-beta.3, which allows to load events from a separate folder with the following hierarchy:

> events
  > messageCreate
    > eventFile1.ts/.js
    > eventFile2.ts/.js
    > ...
  > messageDelete
    > eventFile1.ts/.js
    > eventFile2.ts/.js
    > ...

events = events folder messageCreate/Delete = event folder - must have correct name each folder can have any number of files (when a given event is called, all of them are triggered)

I'll also update the documentation to reflect these changes in a few minutes. I'll ask you to test and report any problems 🙂.

Have a nice Friday afternoon

P.S. DKRCommands now use DJS v14.7.1 😉

Absolutely amazing! This is exactly what I needed! Thank you so much! 💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants