Heatmap Bot Update
Things I learned shipping a Discord bot this week:
1. Railway's restart policy can cause rapid reconnects → Discord IP ban.
Set restartPolicyMaxRetries to 3, not 5. The fewer restarts, the less likely you get rate limited.
2. SQLite is fine for a Discord bot.
WAL mode + aiosqlite = zero issues so far. You don't need Postgres until you're at hundreds of servers with heavy concurrent writes.
3. discord.py slash commands take up to 1 hour to propagate globally.
For instant updates during development, sync to a specific guild instead. But remove guild sync before production or you get duplicates.
4. matplotlib heatmaps are slower than expected (~300ms per render).
Added a global render rate limiter to prevent queue buildup under load. Small optimization, big difference when multiple servers run /heatmap simultaneously.


Replies