Skip to content
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

Closed
DarylJG94 opened this issue Apr 18, 2021 · 4 comments
Closed

Adding and Removing reactions hits guild ratelimits #23

DarylJG94 opened this issue Apr 18, 2021 · 4 comments

Comments

@DarylJG94
Copy link

DarylJG94 commented Apr 18, 2021

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)

@DarylJG94 DarylJG94 changed the title Adding and Removing hits guild ratelimits Adding and Removing reactions hits guild ratelimits Apr 18, 2021
@xMyThoLoGyx
Copy link

Where would you make those changes? Sorry :/ is it in the node module or in your code?

@DarylJG94
Copy link
Author

My apologies for the short delay, it is indeed hitting rate limits when posting the initial reactions. I will provide a pull request shortly

@DarylJG94
Copy link
Author

DarylJG94 commented Apr 22, 2021

See Pullrequest #24

@psibean
Copy link

psibean commented Jun 9, 2021

My apologies for the short delay, it is indeed hitting rate limits when posting the initial reactions. I will provide a pull request shortly

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.

@DarylJG94 DarylJG94 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants