Event Handler for bot

I am not new at coding Discord bots but I am new to the concept of handling commands. I have been looking at Discord bots around GitHub and saw that most of them had a command handler and an event handler. I tried using a tutorial but I found out that they used an older version of fs. So I came here because it was possibly the best place to get help. I don’t really need this now but I will need this in the future.

You can use my custom-coded NPM Package that I made to help newbies make their bot easily. It has a command handler, cooldown and more. Here’s the link: https://www.npmjs.com/package/discord.js-helper and all the instructions to use it are on the README thing.

@SunSOG Thanks, but’s need an event handler. I have a command handler.

1 Like

@SuperWaltC You can just do

client.on("eventnamehere", () => {
//code here

to add a permanent listener to an event. Here’s a list of Discord client events with their arguments passed: https://discord.js.org/#/docs/main/stable/class/Client.

Also, just so you know, event handlers are basically event listeners. I found a YouTube video about adding Discord event listeners. https://youtu.be/Wh188618X4Y