sleepy-discord icon indicating copy to clipboard operation
sleepy-discord copied to clipboard

Calling getUser once results in error.

Open TylerTheFox opened this issue 6 years ago • 5 comments

Calling this exactly once results in this error. getUser(id);

Error 404: The resource at the location specified doesn't exist Error 429: You've made too many requests Error 429: You've made too many requests Error 429: You've made too many requests

Also getUser(id)->username also crashes but for a different reason. Almost every get call does this including getServers, getUser, listMembers.

TylerTheFox avatar Apr 19 '18 08:04 TylerTheFox

to get a 404, I'm going to guess that you may have used an invalid id, but I don't understand how you were able to get that. As for 429, that one is simple, you are hitting rate limits.

yourWaifu avatar Apr 20 '18 05:04 yourWaifu

Happens first try no matter what. Just that one command. Empty project with just that one command and I get a rate limit error.

There's no reason I should get a rate limit error for ONE request.

Even calling auto servs = this->getServers(); once on startup causes a rate limit error.

TylerTheFox avatar Apr 20 '18 05:04 TylerTheFox

Think I figured it out maybe. So getServers() "X-RateLimit-Remaining" header ALWAYS returns zero after being called.

Maybe don't return a "warning" is "X-RateLimit-Remaining" is EQUAL to zero AND response.statusCode equals 200?

TylerTheFox avatar Apr 24 '18 04:04 TylerTheFox

OK, I'll add more conditions before signaling an warning.

yourWaifu avatar Apr 24 '18 04:04 yourWaifu

oops pressed the wrong button, I was about to comment that this maybe that you can only do a get user once in a few seconds.

yourWaifu avatar Apr 24 '18 04:04 yourWaifu