How Events Work
Events
CommandKit handles events by exporting the data as a function, so it follows a structure like
module.exports = (client) => {}to handle them. This is the way that CommandKit will listen for events and handle them accordingly.
Inside the curly braces, you put the functions you would like to be executed when the event is called. This removes the useless hassle for all of the advanced event handlers.
For naming conventions, CommandKit uses the same name for directories as Discord.js uses for events, so for example, to create an event to listen for message deletions, you would create a directory called messageDelete, and you can name the file inside this whatever you like. Same goes for messageUpdate, guildMemberAdd, and ready.
Last updated