From 15894d3469f1544f8a3c7fc3d3614ce7f8bd16ba Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Fri, 14 Jan 2022 01:12:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20joke=20=D0=B8=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE?= =?UTF-8?q?=D0=B1=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/JaBa.js | 3 +-- commands/Fun/joke.js | 2 +- commands/Images/bed.js | 2 +- commands/Images/clyde.js | 2 +- commands/Images/love.js | 2 +- commands/Images/phcomment.js | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/base/JaBa.js b/base/JaBa.js index caa71675..8ea99383 100644 --- a/base/JaBa.js +++ b/base/JaBa.js @@ -49,13 +49,12 @@ class JaBa extends Client { if (this.config.apiKeys.amethyste) this.AmeAPI = new AmeClient(this.config.apiKeys.amethyste); this.icanhazdadjoke = async function() { const joke = await fetch("https://icanhazdadjoke.com/", { - method: "GET", headers: { "Accept": "application/json" } }); - return joke; + return joke.json(); }; this.player = new DisTube.default(this, { diff --git a/commands/Fun/joke.js b/commands/Fun/joke.js index 44bfc3c7..2b06541f 100644 --- a/commands/Fun/joke.js +++ b/commands/Fun/joke.js @@ -19,7 +19,7 @@ class Joke extends Command { async run(message, args, data) { const joke = await this.client.icanhazdadjoke(); - if (joke.status !== "200") return; + if (joke.status === 200) return message.error("misc:ERR_OCCURRED"); const embed = new Discord.MessageEmbed() .setDescription(joke.joke) diff --git a/commands/Images/bed.js b/commands/Images/bed.js index 911921fb..a41f7833 100644 --- a/commands/Images/bed.js +++ b/commands/Images/bed.js @@ -41,7 +41,7 @@ class Bed extends Command { }); } catch (e) { console.log(e); - m.error("misc:ERROR_OCCURRED", null, { + m.error("misc:ERR_OCCURRED", null, { edit: true }); } diff --git a/commands/Images/clyde.js b/commands/Images/clyde.js index 3ce9c40d..f8099ec6 100644 --- a/commands/Images/clyde.js +++ b/commands/Images/clyde.js @@ -36,7 +36,7 @@ class Clyde extends Command { m.delete(); } catch (e) { console.log(e); - m.error("misc:ERROR_OCCURRED", null, { + m.error("misc:ERR_OCCURRED", null, { edit: true }); } diff --git a/commands/Images/love.js b/commands/Images/love.js index 74cefcdf..f7fac6fd 100644 --- a/commands/Images/love.js +++ b/commands/Images/love.js @@ -37,7 +37,7 @@ class Love extends Command { m.delete(); } catch (e) { console.log(e); - m.error("misc:ERROR_OCCURRED", null, { + m.error("misc:ERR_OCCURRED", null, { edit: true }); } diff --git a/commands/Images/phcomment.js b/commands/Images/phcomment.js index c5d494b1..197cd23d 100644 --- a/commands/Images/phcomment.js +++ b/commands/Images/phcomment.js @@ -47,7 +47,7 @@ class Phcomment extends Command { }); } catch (e) { console.log(e); - m.error("misc:ERROR_OCCURRED", null, { + m.error("misc:ERR_OCCURRED", null, { edit: true }); }