feat: custom solve captcha function
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
'use strict';
|
||||
module.exports = class CaptchaSolver {
|
||||
constructor(service, key) {
|
||||
this.service = '';
|
||||
constructor(service, key, defaultCaptchaSolver) {
|
||||
this.service = 'custom';
|
||||
this.solver = undefined;
|
||||
this.defaultCaptchaSolver = defaultCaptchaSolver;
|
||||
this._setup(service, key);
|
||||
}
|
||||
_missingModule(name) {
|
||||
@@ -37,6 +38,9 @@ module.exports = class CaptchaSolver {
|
||||
throw this._missingModule('2captcha');
|
||||
}
|
||||
}
|
||||
default: {
|
||||
this.solve = this.defaultCaptchaSolver;
|
||||
}
|
||||
}
|
||||
}
|
||||
solve() {}
|
||||
|
@@ -28,7 +28,11 @@ class RESTManager {
|
||||
}
|
||||
|
||||
setup() {
|
||||
this.captchaService = new CaptchaSolver(this.client.options.captchaService, this.client.options.captchaKey);
|
||||
this.captchaService = new CaptchaSolver(
|
||||
this.client.options.captchaService,
|
||||
this.client.options.captchaKey,
|
||||
this.client.options.captchaSolver,
|
||||
);
|
||||
}
|
||||
|
||||
get api() {
|
||||
|
Reference in New Issue
Block a user