Rate limited but following rate limits?
Hi, I am trying to program a bot in Python, and currently I want to get all the user message history of a user, so, I am running a command in a while True cycle with a 0.1 seconds wait per cycle.
I know about rate limits, and check the "retry_after" of the 429 code, I wait those second and then I continue.
Also, I follow the bucket rules, so I check the X-RateLimit-Remaining, and if it's = 0 I wait the X-RateLimit-Reset-After.
When I wait for the time given by the headers received, I also add 0.2 just in case my computer's clock is misaligned to Discord's API.
Yet, after a few buckets (2/3 buckets), I start having a 200 status code, and 429. Another 200 status code, and 429. Etc. Why?
After the 429 code I do wait for the Reset-After, as such, I get the 200 code, but why does it give me 200 once, 429 after, and so on? What am I missing?
Edit: Solved, with the gentle help of SolsticeShard, I solved the issue. Or rather, I understood the reason behind the issue. I am on a shared IP, and the 429s I was receiving where because of them. Thank you very much!