#Question about Discord.JS's rate limit handling

14 messages · Page 1 of 1 (latest)

magic temple
#

I used ChatGPT just to have it summarize how Discord.JS handles rate limiting.

My scenario was something along the lines of: "How will Discord.JS handle rate limits if I sent 1 message to 100 different webhooks?"

I wouldn't hit the webhook rate limit, but I would hit the global rate limit.

1: The response from ChatGPT was that Discord.JS (for example) will send 50 of those messages and then queue the remaining requests once the rate limit retry-after time has passed, is this true?

2: If yes to question 1: If not 50, how many requests will Discord.JS send at a time?

3: Is there any sort of method/technique I should be using for my given scenario, or is relying on Discord.JS's rate limit handing fine enough?

Thanks for any answers!

timid iceBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
fringe steppe
#

what exactly is the "given scenario"? why would you send the same message to 100 different webhooks?

#

and also: how do you send them, with Webhook instances you fetched from a Guild or Channel?

magic temple
fringe steppe
magic temple
fringe steppe
#

You‘d have an AnnouncementChannel in each guild then

#

Or have your bot read your global channel idea and post and publish an announcement in your announcement channel rather

#

Using native AnnouncementChannels is way better in terms of strain on the API and won‘t need to worry about ratelimits at all then

#

(Apart from not being able to publish more than a certain amount of messages in a short timeframe)

magic temple
#

Also, I'm not sure 10 publishes per hour will be enough in the future. If that's the case and I decide not to use AnnouncementChannel, although it may put some strain on the API, will it generally be fine to just to use text channels?

fringe steppe
#

You‘ll be heavily rateLimited and possibly still not get more messages done than you would with announcementChannels. And hitting those ratelimits repeatedly can get you into other issues