Elysia
2023-04-07 21:14:19 +07:00
parent f2d3989b61
commit fe840cedf8
3 changed files with 13 additions and 4 deletions

View File

@@ -106,7 +106,7 @@ class APIRequest {
if (captchaKey && typeof captchaKey == 'string') {
if (!this.options.data) this.options.data = {};
// Delete cookie (https://t.me/DMDGOBugsAndFeatures/626) Wtf Unknown Message Error ???
headers.Cookie = undefined;
// headers.Cookie = undefined;
this.options.data.captcha_key = captchaKey;
if (captchaRqtoken) this.options.data.captcha_rqtoken = captchaRqtoken;
}

View File

@@ -382,7 +382,7 @@ class RequestHandler {
if (
data?.captcha_service &&
this.manager.client.options.captchaService &&
request.retries <= this.manager.client.options.captchaRetryLimit &&
request.retries < this.manager.client.options.captchaRetryLimit &&
captchaMessage.some(s => data.captcha_key[0].includes(s))
) {
// Retry the request after a captcha is solved
@@ -398,13 +398,14 @@ class RequestHandler {
data,
this.manager.client.options.http.headers['User-Agent'],
);
await this.manager.client.sleep(5_000);
this.manager.client.emit(
DEBUG,
`Captcha solved.
Method : ${request.method}
Path : ${request.path}
Route : ${request.route}
Key : ${captcha}
Key : ${captcha ? `${captcha.slice(0, 30)}...` : '[Capcha not solved]'}
rqToken : ${data.captcha_rqtoken}`,
);
request.retries++;