mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
docs: improve docs (#4022)
This commit is contained in:
@@ -8,9 +8,13 @@ sidebar_label: Step 4 - Bot
|
||||
Woah! You went through the most difficult part already which was the gateway. WOOT! Let's go ahead and jump into the event handler portion so we can proceed. The event handler will be called as the `bot` process going forward. Its purpose is generally to listen for events coming from the shards and process them accordingly.
|
||||
|
||||
:::tip
|
||||
If you have the money, I would recommend writing the event listener(bot), in a serverless friendly manner. If that code is deployed to something like cloudflare workers, your bot will have unlimited scalability and your shards would simply route these events to be sent there.
|
||||
If you have the money, I would recommend writing the event handler (bot), in a serverless friendly manner. If that code is deployed to something like cloudflare workers, your bot will have unlimited scalability and your shards would simply route these events to be sent there.
|
||||
:::
|
||||
|
||||
## Why Use Standalone Event Handler Process?
|
||||
|
||||
The standalone event handler is the portion of your bot code that you will be changing the most. The two previous steps created processes are intended to never be turned off. This process is designed to let you restart whenever you wish and be incredibly quick to restart. Since we don't have the delay to start up shards anymore, your code becomes reloaded instantly.
|
||||
|
||||
## Creating Bot Manager
|
||||
|
||||
Now we should first create a quick bot manager. Go ahead and make a file like `services/bot/bot.ts` and paste the code below.
|
||||
|
||||
Reference in New Issue
Block a user