Some users are seeing issues where their Discord Bot will go down without any errors or logs, even though the Repl will still be running.
This is due to Discord’s rate-limiting system and the fact that we use shared IPs. Discord blocks access to the Discord API for multiple Repls when a single IP is rate-limited.
We have recognized this issue and are working towards a resolution. Please refer to this forum post for updates on the issue.
Thank you for raising this issue.
I moved my bot from the Heroku platform (it’s clear for what reason) and these problems appeared here.
Last night my bot was disconnected from the Discord API without any errors displayed in the log. I will be following this topic with great attention. I can help if any tests are needed.
This code does not prevent ratelimits. It just restarts when it gets ratelimited and switches IP address. But even after switching it can still get ratelimited.
Replit is just not reliable for hosting Discord bots.
Appreciate that code for restarting on rate limits is hard to test (unless you’re one of the spammer bot owners causing them on replit ), but the code wouldn’t work as expected. restarter.py is an invalid command in the scope of this code (why not just import restarter?) The system commands execute before the kill 1 happens… but you don’t see the 7-second delay because the commands are invalid anyhow.
The code works visibly while you’re looking at the repl because the webview sends a request to the repl right after it recognises that it’s disconnected, so the code restarts. Also the rate limit error would have to not have been caught somewhere else, e.g. by on_error
so does discord.py along with the listed libraries… but they don’t handle invalid request (cloudflare) rate limits, and normal rate limits cause them to wait for long even though someone else on your IP is causing it.
This person was probably using discord.js because this is its behaviour on an invalid request rate limit