#Discord bot (JDA) error : Encountered cloudflare rate limit

23 messages · Page 1 of 1 (latest)

steep ruin
#

I'm hosting a discord bot on pebblehost, and it's been running smoothly for maybe two weeks, and now i'm getting

[ERROR] - Encountered cloudflare rate limit! Retry-After: 2624 s
in the logs, i don't know why this is happening, because it's not like the bot used by thousands or millions, it's used by 20 to 50 people max (the server it's in has around 300 people and not all of them use it) so it's weird.

and in the bot code there isn't any thing repetitive that might trigger a rate limiter.

here's how i initialize it:


    try {
      jda = JDABuilder.createDefault(DISCORD_TOKEN).build();
      jda.getPresence().setActivity(Activity.listening("whatever"));
      jda.addEventListener(new SomeCommand(someService, someRepository, anotherRepository));
      //add other listeners
    } catch (LoginException e) {
      log.error("login exception", e);
      throw new RuntimeException(e);
    }

is there something i can add when creating my jda instance to avoid this rate limiter error?

btw the bot is made with spring boot, i'm more comfortable there.

thanks in advance

idle templeBOT
#

This post has been reserved for your question.

Hey @steep ruin! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

quasi sinew
#

is there something i can add when creating my jda instance to avoid this rate limiter error?
that's not how ratelimits work

#

are you restarting your bot on exit/error or something

steep ruin
steep ruin
#

could this be from the not so perfect handling of exceptions?

quasi sinew
#

it could, there's a lot of things this could be

#

it kinda boils down to just being api spam though

storm root
#

the cloudflare rate limit occurs if too many errornous requests are sent from a single IP

steep ruin
#

do you think this is from discord or pebblehost?

#

i'm logging all requests, and people are using it normally, every 15 minutes or half an hour someone sends a command

storm root
#

either your bot is sending requests that result in errors or pebblehost does

steep ruin
#

i'll try to run it locally and see

storm root
#

another bot on pebblehost*

steep ruin
#

it works on my pc, on pebblehost there's still a rate limiter, good thing it's only 3 minutes left

#

but it's annoying and idk why

#

what other bot hosting platforms you use?

quasi sinew
#

shared ip go brrrrrrr

steep ruin
#

i guess i can't complain paying 3$ or something for it lol

storm root
#

if someone causes errors, they count for all bots on that IP