This addresses the issue announced on the Discord Server.
Unfortunately, the reason the bot is going down is because the bot keeps getting automatically banned by Discord for a few hours at a time for exceeding their single-IP address rate limits.
This is my own guess, but after looking at the verify command and at the rate limits, I thought of how maybe RoVer is hitting the rate limits over the allowed scale.
IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes.
The verify command does around 5-6 edits (if not more) within a really short time, and the rate limits on editing messages depends on the channelId parameter used in the API request, not the messageId itself. This can cause on massive servers (or even small servers) that RoVer will hit the rate limits in that channel. When we scale this up from a medium-sized server (with around 2.5K members) and then scale this up to 100K servers, we can see that we will quickly hit the rate limits stated above, which results in the temporary ban.
My proposed fix is pretty simple: What I did is edit the DiscordMember.js file within the verify function, commenting out all unnecessary status function calls.
With the current version of the code, the bot only shows :bulb: Working... as the initial status, the success message and error messages.
As well to that, I edited package.json to tell Standard (the linter) to ignore DiscordBot.js and index.js that the workflow will run with full success again.
I will expect that with the current workflow, the build will fail since it does not ignore DiscordBot.js or index.js, which currently cause the builds to fail. The actual build result with the updated package.json can be found here: https://github.com/RealSimplyData/RoVer/actions/runs/128632181
This addresses the issue announced on the Discord Server.
This is my own guess, but after looking at the verify command and at the rate limits, I thought of how maybe RoVer is hitting the rate limits over the allowed scale.
The verify command does around 5-6 edits (if not more) within a really short time, and the rate limits on editing messages depends on the
channelId
parameter used in the API request, not themessageId
itself. This can cause on massive servers (or even small servers) that RoVer will hit the rate limits in that channel. When we scale this up from a medium-sized server (with around 2.5K members) and then scale this up to 100K servers, we can see that we will quickly hit the rate limits stated above, which results in the temporary ban.My proposed fix is pretty simple: What I did is edit the
DiscordMember.js
file within theverify
function, commenting out all unnecessarystatus
function calls. With the current version of the code, the bot only shows:bulb: Working...
as the initial status, the success message and error messages.As well to that, I edited
package.json
to tell Standard (the linter) to ignoreDiscordBot.js
andindex.js
that the workflow will run with full success again.I will expect that with the current workflow, the build will fail since it does not ignoreDiscordBot.js
orindex.js
, which currently cause the builds to fail. The actual build result with the updatedpackage.json
can be found here: https://github.com/RealSimplyData/RoVer/actions/runs/128632181