mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 05:04:58 +05:00
Фикс joke и сообщения об ошибке
This commit is contained in:
parent
294d4f87c0
commit
15894d3469
6 changed files with 6 additions and 7 deletions
|
@ -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, {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue