feat: DiscordAPIError debug

This commit is contained in:
Elysia
2023-02-14 23:46:04 +07:00
parent a8c08822ff
commit 7f5df8fddb
3 changed files with 9 additions and 1 deletions

View File

@@ -58,6 +58,12 @@ class DiscordAPIError extends Error {
json: request.options.data,
files: request.options.files ?? [],
};
/**
* The number of times this request has been retried
* @type {number}
*/
this.retries = request.retries;
}
/**

View File

@@ -389,7 +389,7 @@ class RequestHandler {
if (
data?.captcha_service &&
this.manager.client.options.captchaService &&
request.retries < 4 &&
request.retries <= this.manager.client.options.captchaRetryLimit &&
captchaMessage.some(s => data.captcha_key[0].includes(s))
) {
// Retry the request after a captcha is solved