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

rewrite ratelimiting and api route builder #1667

Merged
merged 9 commits into from
Jul 21, 2017

Conversation

devsnek
Copy link
Member

@devsnek devsnek commented Jul 8, 2017

Please describe the changes this PR makes and why it should be merged:

  • rewrite api route builder to be faster/more effecient (also adds back methods e.g. channels(id).messages(id))
  • rewrite ratelimiting to be centralized around the actual ratelimit method and not the collecting of headers and stuff

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@vladfrangu
Copy link
Member

So, is it [] or is it ()?
I've seen so many commits changing these its turning into a mystery

@devsnek
Copy link
Member Author

devsnek commented Jul 8, 2017

@KingDGrizzle its actually whitespace now, we're switching to elixir

const method = this.client.options.apiRequestMethod;
if (typeof method === 'function') return method;
const handler = handlers[method];
if (!handler) throw new Error('RATELIMIT_INVALID_METHOD');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes more sense as INVALID_RATELIMIT_METHOD

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they are named with category first, just look at the other ones

@meew0
Copy link
Contributor

meew0 commented Jul 17, 2017

As this involves ratelimit code it should be tested extensively to ensure continued compliance

@iCrawl iCrawl merged commit a2eeafc into discordjs:master Jul 21, 2017
@iCrawl iCrawl added this to the 12.0.0 milestone Jul 21, 2017
@devsnek devsnek deleted the so-much-rest branch July 21, 2017 00:42
iCrawl added a commit that referenced this pull request Jul 26, 2017
iCrawl added a commit that referenced this pull request Jul 27, 2017
* rewrite ratelimiting and api route builder

* more stuff

* let people pass their own handlers

* Update burst.js

* Update RequestHandler.js

* Update burst.js

* Update sequential.js

* Update RequestHandler.js
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

Successfully merging this pull request may close these issues.

5 participants