Rate Limit
is it possible to retrieve the header returned when the bot is being rate limited by discord when sending messages? according to https://discord.com/developers/docs/topics/rate-limits
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
9 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- 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!djs handles reatelimits
for you
like if I were to spam messages, the bot will still be able to send them successfully without any error?
itd queue them
but dont spam the api
how
djs does it for you
So I was planning on doing something like suppose after sending 10 messages the bot gets rate limited and I fetch the
X-RateLimit-Reset-After
parameter and setTimeout
to that many seconds then start sending message again. Is that the right way to do it?
I was planning on making a bot that sends DMs to all members in the server
is there any way to avoid a rate limit?Ratelimits are dynamically assigned by the API based on current load and may change at any point.
- The scale from okay to API-spam is sliding and depends heavily on the action you are taking
- Rainbow roles, clock and counter channels, and DM'ing advertisements to all members are all examples of things that are not okay
hmm