mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-25 14:44: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);
|
if (this.config.apiKeys.amethyste) this.AmeAPI = new AmeClient(this.config.apiKeys.amethyste);
|
||||||
this.icanhazdadjoke = async function() {
|
this.icanhazdadjoke = async function() {
|
||||||
const joke = await fetch("https://icanhazdadjoke.com/", {
|
const joke = await fetch("https://icanhazdadjoke.com/", {
|
||||||
method: "GET",
|
|
||||||
headers: {
|
headers: {
|
||||||
"Accept": "application/json"
|
"Accept": "application/json"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return joke;
|
return joke.json();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.player = new DisTube.default(this, {
|
this.player = new DisTube.default(this, {
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Joke extends Command {
|
||||||
|
|
||||||
async run(message, args, data) {
|
async run(message, args, data) {
|
||||||
const joke = await this.client.icanhazdadjoke();
|
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()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setDescription(joke.joke)
|
.setDescription(joke.joke)
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Bed extends Command {
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
m.error("misc:ERROR_OCCURRED", null, {
|
m.error("misc:ERR_OCCURRED", null, {
|
||||||
edit: true
|
edit: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Clyde extends Command {
|
||||||
m.delete();
|
m.delete();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
m.error("misc:ERROR_OCCURRED", null, {
|
m.error("misc:ERR_OCCURRED", null, {
|
||||||
edit: true
|
edit: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Love extends Command {
|
||||||
m.delete();
|
m.delete();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
m.error("misc:ERROR_OCCURRED", null, {
|
m.error("misc:ERR_OCCURRED", null, {
|
||||||
edit: true
|
edit: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Phcomment extends Command {
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
m.error("misc:ERROR_OCCURRED", null, {
|
m.error("misc:ERR_OCCURRED", null, {
|
||||||
edit: true
|
edit: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue