Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Hitting Cloudflare Blocks #60

Closed
shubhamshah02 opened this issue May 19, 2021 · 2 comments
Closed

Hitting Cloudflare Blocks #60

shubhamshah02 opened this issue May 19, 2021 · 2 comments

Comments

@shubhamshah02
Copy link

Hey there, I am on the latest version of dpymenus and for some reason, I am hitting Cloudflare blocks on my bot. Is there any way to fix this?

@robertwayne
Copy link
Owner

Are you receiving a specific response error code?

The only way you'd come close to triggering that is if someone was basically spamming reaction-based menus without a cooldown. Remember, every reaction is a single request to the API (as Discord doesn't supply a bulk reaction add endpoint) -- so a menu with 5 buttons is going to be 6 requests (1 for the create message, 5 for add reaction). In addition, I pad requests with a delay so your buttons aren't overflowing the rate limit buckets. But lots of people opening lots of menus would still count toward your global limit per IP.

It's really, really difficult to get yourself Cloudflare banned without having some piece of code that is making a ton of requests a second. You can change your logging level to DEBUG to see each http request you are making. I did double-check my test suite, just to be safe, and I don't see any requests out of the necessary*.

*I did make a change in today's update to prevent one extra request during high latency, however, which may help.

@shubhamshah02
Copy link
Author

Hasn’t happened since again. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants