Please describe the problem you are having in as much detail as possible:
When replying to commands, messages will sometimes get "stuck" and will not be properly sent until the bot attempts to send another message in that channel, causing it to spit out any queued up messages. Probably important to mention that Pokécord (The bot having this problem) requires a lot of activity, meaning it is more likely to be rate limited.
The issue seems to be the same as #1949 and #1985 , however both of these issues were on older versions of discord.js.
Further details:
Priority this issue should have – Medium - Depends on the size and functionality of the bot.
[ ] I found this issue while running code on a __user account__
After looking into the issue I have found the problem:
In sequential.js the handler will return if:
After some testing I found that the requests would get stuck if they were handled while this.limited was true, and after looking into it more the problem came from the bot being globally rate limited.
When a bot is globally rate limited discord.js will correctly stop sending requests by setting this.globallyLimited to true, however if a request is queued while the bot is globally rate limited it will stop handling the requests all together.
All that is needed to fix this issue is a way of getting discord.js to start handling requests again after the global rate limit clears.
Most helpful comment
After looking into the issue I have found the problem:
In sequential.js the handler will return if:
After some testing I found that the requests would get stuck if they were handled while this.limited was true, and after looking into it more the problem came from the bot being globally rate limited.
When a bot is globally rate limited discord.js will correctly stop sending requests by setting this.globallyLimited to true, however if a request is queued while the bot is globally rate limited it will stop handling the requests all together.
All that is needed to fix this issue is a way of getting discord.js to start handling requests again after the global rate limit clears.