Closed BOLT04 closed 3 years ago
If you would like to continue contributing to open source and would like to do it with an awesome inclusive community, you should join our Discord chat and our GitHub Organisation - we help and encourage each other to contribute to open source little and often 🤓 . Any questions let us know.
For this issue, we want to update this section to explain what JS module is responsible for the command routing and provide more information.
I prepared a draft for this, so if anyone wants to make this change (and tweak the text if you want) and open a PR, we are more than glad to review it 😃. Just ping us and we'll assign this to you 👍.
If you are new to Discord bot development, here is a small introduction about the flow of something happening on the Discord server to the bot.
When a message is sent by a user on the Discord server, the Discord app sends an event to the Discord Gateway, which then sends that event to the clients that are connected to it with WebSockets, in our case Discord.js.
The start of the program is at src/index.ts
, and here we register an event handler (the function exported on src/commands.ts
) for the message
event here. The client library (Discord.js) will call that function when it receives the message
event from the Discord Gateway, and this is where the commands exported in the src/commandHandlers/index.ts are used and where there is logic to decide which one to call.
All the commands are located in the folder src/commandHandlers
so that each command has its own file. They are then executed in src/commands.ts
when a user types a command with the configured command prefix in config.ts.
To create a new command, follow these steps: ..........
awesome! I would raise a PR with the "draft", because the extra information will be beneficial, then more improvements can come later
Stale issue message
github-actions has itchy fingers today, huh.
Stalebot is going for it 😂
I would like to make the changes!
Awesome, thanks @ChinmayMhatre . I have assigned the ticket to you 🤓
Made the changes !
Current docs.
Discussion that lead to this issue: https://github.com/EddieJaoudeCommunity/EddieBot/issues/237#issuecomment-695211579.