EddieHubCommunity / EddieBot

Inclusive words Discord bot (no more "hey guys")
http://discord.eddiehub.org
MIT License
173 stars 139 forks source link

Improve commands routing docs in README #238

Closed BOLT04 closed 3 years ago

BOLT04 commented 4 years ago

Current docs.

Discussion that lead to this issue: https://github.com/EddieJaoudeCommunity/EddieBot/issues/237#issuecomment-695211579.

github-actions[bot] commented 4 years ago

It's great having you contribute to this project

Feel free to raise an Issue! Welcome to the community :nerd_face:

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.

BOLT04 commented 4 years ago

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 👍.


How to add a new command to the bot

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.

Introduction

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.

Steps to create a new command

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: ..........

eddiejaoude commented 4 years ago

awesome! I would raise a PR with the "draft", because the extra information will be beneficial, then more improvements can come later

github-actions[bot] commented 3 years ago

Stale issue message

mikeysan commented 3 years ago

github-actions has itchy fingers today, huh.

eddiejaoude commented 3 years ago

Stalebot is going for it 😂

ChinmayMhatre commented 3 years ago

I would like to make the changes!

eddiejaoude commented 3 years ago

Awesome, thanks @ChinmayMhatre . I have assigned the ticket to you 🤓

ChinmayMhatre commented 3 years ago

Made the changes !