Event Handling
Last updated
Last updated
WOKCommands can automatically handle your event listening in multiple files and folders. You can even setup "dynamic validations" to only run some events when a specific condition is met. More on that in the next section of the documentation.
Here is an example of how to setup a basic event listening system:
Inside of your "events" folder should be nested folders that directly match the event you want to listen to. An example of the "messageCreate" event:
All files inside of the "messageCreate" folder will be ran when the event is emitted. The function inside of your event files should have all of the normal parameters for the event, plus an additional "WOKCommands" instance parameter at the end: