Check a bot before it runs unattended, with the guide section that explains each item
Before the First Start
- Run Node.js 24.15 or newer
- Read the token from
process, never from a source file or an image.env .FLUXER_ BOT_ TOKEN
Explained in: Runtime requirements · Preparing the bot
Failures
- Return or check every Result, the success or failure each request gives, so a failed send is reported instead of lost
- Send failures somewhere someone reads, with an
onErrorhook or a log sink - Do not resend a write whose outcome is unknown
- Leave rate limits to the SDK, which waits for HTTP
429on its own
Explained in: Returning the Result · Failures in one place · An existing logger · Sending once · Retry rules
Running Unattended
- Turn on only the caches the bot reads, and size them for its communities
- Give the process manager a stop timeout of about 30 seconds
- Restart after a crash with a delay
- Add a session store, so a quick restart resumes and gets the events it missed
- Watch the connection and each event subscription the bot cannot work without, which
runBotalready does
Explained in: Cache settings · Shutdown · Restart policy · Resuming after a restart · Watching the connection
Before Each Deploy
- Run offline tests, as in writing a first test