Editing Message Rate Limits

Hey there, I noticed some interesting behavior when it comes to editing messages that I had some questions about. I noticed that when editing a webhook message (may also apply to non-webhook messages) quickly, discord.js handles the rate limits and the edits slowly catch up with time. However, I noticed that if one message is currently catching up with edits, and I send another webhook message and start editing that one, once the first message finishes being completely edited, the other one starts getting edited. However, the difference is, in the second message, the edits immediately catch up to the most recent edit. Is there a way to achieve this type of behavior (where it catches up immediately) for the first message in this scenario? When I edit a message quickly, I'm looking for it to try and update to the most recent version of the message (if it is unable to do so immediately due to rate limits) instead of trying to catch up the edits. Let me know if anyone knows about this (or if you have any questions) 🤔
2 Replies
d.js toolkit
d.js toolkit17mo ago
- 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!
monbrey
monbrey17mo ago
I'm not fully across out rate limit handling, but it seems like we might be putting both messages into the same bucket/queue when we shouldn't be The first one isn't going to be instant, because its still waiting on the same rate limit. It's a queue, not a state engine that will only maintain the latest state The second message though, seems like its putting them at the end of the same bucket. But when it starts processing them, there's no rate limit in reality, so it processes them all right away
Want results from more Discord servers?
Add your server