Discord Ratelimit

I am also having this issue with my discord bots. This is really unfortunate because I really like using Replit but am forced to look for another hosting solution.

1 Like

A thing replit members could do is assign an dynamic ip to 500 users every 3-7 days, it would fix the ratelimiting problem to some people who is actually using replit to host their discord bots. who knows they might be hosting a big one.

I don’t think assigning an dynamic ip to 5-10 users every 3-7 days would fix the ratelimiting problem, but if replit members could try if it fixes this issue, this would be good.

(i could be wrong, since i don’t think this is possible)

1 Like

curious if you could use an HTTP Proxy IP from discord.py… just clone it and change every request to request through a proxy ip instead.

if anyone were able to pull this off, it would change hosting discord.py bots on replit.

1 Like

this is a big isue for me

1 Like

We are now running an experiment with a Discord proxy with a rate-limiter to combat abusive Repls, and we’re seeing Repl connectivity to Discord at nearly 100%. Please try running your bots and let us know how your experience is.


For those curious about the details:

Repls share external IP addresses with each other. If one bad Repl gets banned by Discord, it takes out all the other Repls using that same address. To make Replit safe for people to use Discord, we need to set some boundaries.

As an experiment, we’ve added entries to /etc/hosts and a self-signed HTTPS certificate that lets us pretend to be Discord (only in Repls). The proxy limits Repl requests to Discord to one at a time, enforces Discord’s rate-limiting headers, and severely rate limits any Repl that gets a 4xx response code from Discord (this is what gets the shared IP addresses banned).

We would like your feedback on how to make this experiment permanent. No matter which option we go with, we need to block direct connections to Discord.

Which of these possible options would you prefer:

  1. Like how it is now. We keep having a self-signed certificate. When you connect to Discord, it transparently goes through our proxy. We could potentially add a setting that lets you opt in or out of this feature, if there is demand.
  2. You opt in to the proxy by using a different URL to connect (for example, you use discordproxy.replit.com instead of discord.com)
13 Likes

I’d rather have the first one - as it’s much easier to setup bots and not really many people know how to substitute the actual Discord URLs with a different one.

2 Likes

so wouldn’t you want the first one?

1 Like

oh right i’m dumb haha

I’d like option one but it depends on where the setting would be located. Preferably this can be changed in the .replit file so some templates can opt-in and others don’t.

1 Like

Could you share why you would like to opt in or out?

2 Likes

Well obviously opting in helps with ratelimits, so this should probably be enabled by default. But opting out of experimental features should always be an option.

4 Likes

good day! I am a bot dev using discord.js (currently) and running 6 discord bots for 5 specific servers (which am keeping in mind the 20 active repls limit). On a personal standpoint, I feel like option one would be preferred since I am not a professional dev (I am learning python for college so things like these are new to me) and I think it is easy to put settings to help us easily understand.

Looking at both ways though should option 2 be preferred by many (though unlikely this would be chosen) it would help that a guide may be provided for new and professional developers to issue the bot to connect to the proxy.

Cheers and good luck!

3 Likes

I really appreciate the efforts that went into making sure hosting Discord bots is viable on Replit again! It’s a relief after seeing complaining users regarding ratellimits and kill 1s every day and having to point them to custom auto-kill solutions.

I think it’s obvious that option 1 is the only one that could work on a large scale. If users are required to patch Discord-API libraries or perform configuration, the adoption would be low.

4 Likes

Welcome to the community! I think there should be info in the docs.

1 Like

I’m logging any connect errors with Replit to a file and the last time it failed (knock on wood) was 3th of Jan 2023 with the error:

Tue Jan 03 2023 19:15:15 GMT+0000 (Coordinated Universal Time) - Fail reason: Error: unable to verify the first certificate

Don’t know what that error’s about. However, it seems to have been fine since then.

2 Likes

just a question, am i still required to use kill 1 incase an ip gets banned?

2 Likes

Yes but you should not need to because of the fix

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.