Фикс joke и сообщения об ошибке

This commit is contained in:
JonnyBro 2022-01-14 01:12:46 +05:00
parent 294d4f87c0
commit 15894d3469
6 changed files with 6 additions and 7 deletions

View file

@ -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, {

View file

@ -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)

View file

@ -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
});
}

View file

@ -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
});
}

View file

@ -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
});
}

View file

@ -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
});
}