In the previous version, different parts of the bot were in different folders, e.g. the ticket system was in the listeners/interactionCreate file, some commands were in the actions file, other commands were just somewhere
What happened?
There are different types of events:
Events
buttons (= on a button click)
commands (= when a /-command is runned)
menuInteractions (= when a string menu is used to select something)
messageContextMenuInteractions (= when something is clicked in a message context menu)
userContextMenuInteractions (= when something is clicked in a user context menu)
tick (= every minute)
Each event has got a folder. All data about this event are in a single file in the folder it belongs to.
Handler
When the bot starts, it reads each of the directory and imports the files, check them for validity and adds them to the handler. When an event occurs, it will run the execute method inside the belonging file. Commands are being registred to the discord api based on the data from the filed inside the directories.
How to work with it?
When you want to do something on an event, add a file into the correct folder. The main file will find the file and use it when needed. To make the file valid, you need to export the correct type (see commandTypes.ts), else the bot will ignore it.
Look at the files I've already created and just replicate the same, then it will work ;)
Why?
In the previous version, different parts of the bot were in different folders, e.g. the ticket system was in the listeners/interactionCreate file, some commands were in the actions file, other commands were just somewhere
What happened?
There are different types of events:
Events
Each event has got a folder. All data about this event are in a single file in the folder it belongs to.
Handler
When the bot starts, it reads each of the directory and imports the files, check them for validity and adds them to the handler. When an event occurs, it will run the execute method inside the belonging file. Commands are being registred to the discord api based on the data from the filed inside the directories.
How to work with it?
When you want to do something on an event, add a file into the correct folder. The main file will find the file and use it when needed. To make the file valid, you need to export the correct type (see commandTypes.ts), else the bot will ignore it. Look at the files I've already created and just replicate the same, then it will work ;)
Questions?
Just ask :)