From a6099af525e9da71856a5898c7d4336c15116fb4 Mon Sep 17 00:00:00 2001 From: March 7th <71698422+aiko-chan-ai@users.noreply.github.com> Date: Thu, 22 Dec 2022 18:51:49 +0700 Subject: [PATCH] fix: CaptchaSolver - Cannot read properties of undefined (reading 'slice') --- src/rest/CaptchaSolver.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/rest/CaptchaSolver.js b/src/rest/CaptchaSolver.js index 1b8a15e..82966b5 100644 --- a/src/rest/CaptchaSolver.js +++ b/src/rest/CaptchaSolver.js @@ -47,9 +47,7 @@ module.exports = class CaptchaSolver { sitekey: siteKey, url: 'https://discord.com', }) - .then(res => { - resolve(res); - }) + .then(res => (res ? resolve(res) : reject(new Error('Captcha could not be solved')))) .catch(reject); }); break;