diff --git a/src/client/Client.js b/src/client/Client.js index 681005d..3828dd3 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -436,18 +436,13 @@ class Client extends BaseClient { /** * Sign in with the QR code on your phone. - * @param {boolean} debug Debug mode + * @param {DiscordAuthWebsocketOptions} options Options * @returns {DiscordAuthWebsocket} * @example * client.QRLogin(); */ - QRLogin(debug = false) { - const QR = new DiscordAuthWebsocket({ - autoLogin: true, - userAgent: this.options.http.headers['User-Agent'], - wsProperties: this.options.ws.properties, - debug, - }); + QRLogin(options = {}) { + const QR = new DiscordAuthWebsocket(options); this.emit(Events.DEBUG, `Preparing to connect to the gateway (QR Login)`, QR); return QR.connect(this); } diff --git a/src/util/RemoteAuth.js b/src/util/RemoteAuth.js index ebf995c..f62da54 100644 --- a/src/util/RemoteAuth.js +++ b/src/util/RemoteAuth.js @@ -155,6 +155,7 @@ new DiscordAuthWebsocket({ apiVersion: 9, userAgent: defaultUA, wsProperties: defaultClientOptions.ws.properties, + captchaHandler: () => new Error('Captcha Handler not found. Please set captchaHandler option.'), }; if (typeof options == 'object') { if (typeof options.debug == 'boolean') this.options.debug = options.debug; diff --git a/typings/index.d.ts b/typings/index.d.ts index 3eea5eb..0de1adb 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -952,7 +952,7 @@ export class Client extends BaseClient { public login(token?: string): Promise; public normalLogin(username: string, password?: string, mfaCode?: string): Promise; public switchUser(token: string): void; - public QRLogin(debug?: boolean): DiscordAuthWebsocket; + public QRLogin(options?: DiscordAuthWebsocketOptions): DiscordAuthWebsocket; public remoteAuth(url: string, forceAccept?: boolean): Promise; public createToken(): Promise; public checkUpdate(): Promise;