-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding and Removing reactions hits guild ratelimits #23
Comments
Where would you make those changes? Sorry :/ is it in the node module or in your code? |
My apologies for the short delay, it is indeed hitting rate limits when posting the initial reactions. I will provide a pull request shortly |
See Pullrequest #24 |
How many reactions did you have? Was this across multiple servers at a time? The global rate limit is 50 requests per second and there's no mention of an individual limit on the create reaction endpoint - so I'm struggling to see how you're getting 50 reacts just on the INITIAL reactions. Are you able to provide a minimal repository and the use case that replicates this? Edit: if this is actually an issue, I'm not sure a hard coded timeout is the way to fix it. The exceptions (if any) should be exposed to the user for handling. Any timeouts should be configurable, and I'd like to have such changes incorporated into my PR which significantly restructures this module. |
The way the module currently works with adding the reactions directly after reachother and the instant removal of reactions causes the bot to hit discords ratelimits incredibly quick, as a little hack workaround I have made the following changes:
setTimeout(async()=>{ await curPage.react(emojiList[0]); },1000);
setTimeout(async()=>{ await curPage.react(emojiList[1]); },3000);
instead of the forloop, and the removal of reactions:
setTimeout(async ()=> { reaction.users.remove(msg.author); },2000)
The text was updated successfully, but these errors were encountered: