mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
docs: Fixed some missing docstrings or incorrect return types (#2093)
* Fix some missing doc strings
Mainly just readonly tags
* Return an error when guild#allowDMs is ran from a bot account, and fix some return types
* WebhookClient implements Webhook, doesn't extend it
* Fix Client#rateLimit docs not showing what it returns
Cause I wanted to handle this event only to see no return props 🤔
* Actually make Client#rateLimit show the right info
Its an object with all the info
This commit is contained in:
@@ -39,12 +39,13 @@ class RequestHandler {
|
||||
/**
|
||||
* Emitted when the client hits a rate limit while making a request
|
||||
* @event Client#rateLimit
|
||||
* @prop {number} timeout Timeout in ms
|
||||
* @prop {number} limit Number of requests that can be made to this endpoint
|
||||
* @prop {number} timeDifference Delta-T in ms between your system and Discord servers
|
||||
* @prop {string} method HTTP method used for request that triggered this event
|
||||
* @prop {string} path Path used for request that triggered this event
|
||||
* @prop {string} route Route used for request that triggered this event
|
||||
* @param {Object} rateLimitInfo Object containing the rate limit info
|
||||
* @param {number} rateLimitInfo.timeout Timeout in ms
|
||||
* @param {number} rateLimitInfo.limit Number of requests that can be made to this endpoint
|
||||
* @param {number} rateLimitInfo.timeDifference Delta-T in ms between your system and Discord servers
|
||||
* @param {string} rateLimitInfo.method HTTP method used for request that triggered this event
|
||||
* @param {string} rateLimitInfo.path Path used for request that triggered this event
|
||||
* @param {string} rateLimitInfo.route Route used for request that triggered this event
|
||||
*/
|
||||
this.client.emit(RATE_LIMIT, {
|
||||
timeout,
|
||||
|
||||
Reference in New Issue
Block a user