3

When I run my discord bot on repl.it, I get an error. within the error, I see some HTML code below. It seems like CloudFlare is blocking my bot from accessing Discord. What could have caused this?

   <section class="w-240 lg:w-full mx-auto mb-8 lg:px-8">
          <div id="what-happened-section" class="w-1/2 md:w-full">
            <h2 class="text-3xl leading-tight font-normal mb-4 text-black-dark antialiased" data-translate="what_happened">What happened?</h2>
            <p>The owner of this website (discord.com) has banned you temporarily from accessing this website.</p>```

Ownwn
  • 31
  • 2
  • 3
  • 2
    You were either spamming the API and you got blacklisted or someone else using the same website spammed the API and got blacklisted. – Tin Nguyen May 05 '21 at 11:33

7 Answers7

12

You say that you’re using replit… Replit uses shared ip addresses, and the cloud flare bans are based on ip addresses. Effectively, you’re likely to be sharing an IP address with many other people’s bots, and that’s why you get ratelimited and/or temporarily banned, as from the server side, it looks like they’re getting spammed requests from a single IP address. You can type kill 1 into the shell to attempt to restart the repl on a different ip, although, this may only be a temporary solution. If you’re still getting banned, and you’re using a package that handles ratelimits, then switching hosts may solve the problem.

Infinity
  • 161
  • 1
  • 8
  • 4
    `kill 1` worked for me, thanks! – Lauren Yim May 24 '22 at 12:59
  • My bot gets banned after every 2 days. It is very important for my bot to be online 24/7 as my bot is a prize tracking bot. So can it be hosted anywhere other than Replit? Or is there any way by which this bot is not banned and does not have to use kill 1 again and again. – Harsh Gaur Sep 23 '22 at 03:37
  • It is possible, yes. The only other free host I know of is heroku, which is now no longer free. If you can afford it, a cheap vps is a lot less effort to use (as its far more quicker and responsive), than another free host that you may struggle to find. – Infinity Sep 24 '22 at 06:29
  • Also, if your bot gets banned, you could detect this in this code, and execute the kill 1 command from inside your script. – Infinity Sep 24 '22 at 06:30
  • Hello, I'm facing this issue as well, I tried `kill 1` but it didn't seem to work. Would it work if we used a proxy to connect to discord so as to change our IP? – AzlanCoding Sep 24 '22 at 07:45
  • I tried to use the proxies from https://proxy-list.download/HTTP but they just crash my reply so badly that it take some time before I can even open it up again – AzlanCoding Sep 24 '22 at 07:47
  • `bot = commands.Bot(intents=intent,command_prefix='$', enable_debug_events=True, proxy="http://222.139.221.185:9091")` is what I tried to do – AzlanCoding Sep 24 '22 at 07:48
  • Honestly, I don't think these proxies I'm using work at all... – AzlanCoding Sep 24 '22 at 07:51
  • Anyone has any idea how to change the ip of linux without `sudo` ??? I would really wish that I can use [vpngate.py](https://gist.github.com/Lazza/bbc15561b65c16db8ca8) but it needs sudo. – AzlanCoding Sep 24 '22 at 09:07
  • If you're really unlucky using `kill 1`, the repl can restart on another blocked IP address, and the same error can occur. Sometimes running `kill 1` multiple times might theoretically be necessary. – Infinity Sep 24 '22 at 10:50
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/248317/discussion-between-azlancoding-and-infinity). – AzlanCoding Sep 24 '22 at 10:57
2

This happens on replit because you (or someone else) was flooding the Discord API. Just wait a bit and the ban should be lifted. If you are trying to host a discord bot, maybe do not use replit...

Echo
  • 160
  • 1
  • 13
  • 3
    This answer is not adding anything useful, that was not mentioned in other questions. Try to upvote other answeres, if you find them to be helpful instead of repeating them in your own answer. That way people looking for a solution will have to read only the answers with the most upvotes to get the best answer. – Jakob Stark Feb 15 '22 at 10:27
1

Discord has banned the replit ip thats shared with many other people. Just wait and you'll be unbanned

pelaajahacks
  • 191
  • 1
  • 6
0

It appears that you've been blacklisted. This can happen for numerous reasons, but if I were to guess either you or someone else were spamming the Discord API, which gets you blacklisted. Try to connect again in a couple days, maybe a week or longer. Just note that this might happen multiple times. I have a friend who used replit quite a lot and this happened multiple times.

-1

This is because you have been sending too many requests using your bot. Discord wants no spamming bots in its system so it just blocks it. Try waiting around 15 minutes and then run it. Remember to not spam the bot.

-2

This is because you have restarted the bot too many times in a certain amount of time and gotten temporarily banned, wait from 24h up to 72h and it should be fixed.

-3

I think that you might need to make another bot and don't use external libraries or APIs that is blacklisted. Instead, you can use official APIs from discord or other famous (verified) APIs.