Improve docs a bit

This commit is contained in:
Crawl
2017-04-30 04:30:44 +02:00
parent 3f8c0a4d11
commit ac92d2cecc
83 changed files with 716 additions and 711 deletions

View File

@@ -1,5 +1,5 @@
/**
* Represents an error from the Discord API
* Represents an error from the Discord API.
*/
class DiscordAPIError extends Error {
constructor(error) {
@@ -16,7 +16,7 @@ class DiscordAPIError extends Error {
}
/**
* Flattens an errors object returned from the API into an array
* Flattens an errors object returned from the API into an array.
* @param {Object} obj Discord errors object
* @param {string} [key] idklol
* @returns {string[]}

View File

@@ -14,14 +14,14 @@ class RequestHandler {
this.restManager = restManager;
/**
* A list of requests that have yet to be processed.
* A list of requests that have yet to be processed
* @type {APIRequest[]}
*/
this.queue = [];
}
/**
* Whether or not the client is being rate limited on every endpoint.
* Whether or not the client is being rate limited on every endpoint
* @type {boolean}
* @readonly
*/
@@ -34,7 +34,7 @@ class RequestHandler {
}
/**
* Push a new API request into this bucket
* Push a new API request into this bucket.
* @param {APIRequest} request The new request to push into the queue
*/
push(request) {
@@ -42,7 +42,7 @@ class RequestHandler {
}
/**
* Attempts to get this RequestHandler to process its current queue
* Attempts to get this RequestHandler to process its current queue.
*/
handle() {} // eslint-disable-line no-empty-function

View File

@@ -24,7 +24,7 @@ class SequentialRequestHandler extends RequestHandler {
/**
* The time difference between Discord's Dates and the local computer's Dates. A positive number means the local
* computer's time is ahead of Discord's.
* computer's time is ahead of Discord's
* @type {number}
*/
this.timeDifference = 0;
@@ -42,7 +42,7 @@ class SequentialRequestHandler extends RequestHandler {
}
/**
* Performs a request then resolves a promise to indicate its readiness for a new request
* Performs a request then resolves a promise to indicate its readiness for a new request.
* @param {APIRequest} item The item to execute
* @returns {Promise<?Object|Error>}
*/