undiscord
undiscord copied to clipboard
[ENHANCEMENT] Possible solution to API rate limiting/Very slow deletion: require testers
Is your feature request related to a problem? Please describe. It seems to me that Discord has changed something about their algorithms that has caused the script to work less effectively than before and I have a hypothesis that it's due to the constant/consistent API requests rather than the time in between requests.
Describe the solution you'd like For users who have had issues with running into API limits to test this gist to see if it solves the issue, preferably people who are able and willing to alter JavaScript variables to find optimal deletionDelay values.
the gist : https://gist.github.com/AirikWarren/12b8a72abf6bf17fe3b9e75d19d60743
WARNINGS
Please note that this script in it's current state likely breaks / overrides the previous method of adjusting the deletion delay after hitting API limits but should still maintain the "cooldown" behavior. With the very conservative default deletionDelay values you shouldn't be hitting the API limit but it is still important to be aware of, particularly if you adjust the values of minDeleteDelay, maxDeleteDelay, and deletionDelay and run the script without monitoring it's behaivor and manually stop it once API limits are reached.
What testing is most needed
Finding values that trigger API rate limiting (ie. many users report this occurring even 1000 or 1100 ms) and seeing whether or not you run into these issues with this script or it helps mitigate it.
Yes, the general REST API rate limit is 3600/1h (which averages to 1/s). For more, you will need to use a bot with privileged intents enabled or reverse engineer the official client's RPC. If the messages you want to delete are younger than 2 weeks, you can also use the bulk delete endpoint, which accepts up to 100 deletions per request, and only counts as one use per request in the rate limiting.