2022-01-13 00:56:24 +05:00
|
|
|
const Command = require("../../base/Command"),
|
2022-01-04 02:18:28 +05:00
|
|
|
Discord = require("discord.js");
|
|
|
|
|
|
|
|
class Joke extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: "joke",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: true,
|
|
|
|
guildOnly: false,
|
2022-01-05 22:04:46 +05:00
|
|
|
aliases: ["jo"],
|
2022-01-04 02:18:28 +05:00
|
|
|
memberPermissions: [],
|
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
|
|
|
cooldown: 2000
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(message, args, data) {
|
2022-01-14 00:52:51 +05:00
|
|
|
const joke = await this.client.icanhazdadjoke();
|
2022-01-14 01:12:46 +05:00
|
|
|
if (joke.status === 200) return message.error("misc:ERR_OCCURRED");
|
2022-01-04 02:18:28 +05:00
|
|
|
|
|
|
|
const embed = new Discord.MessageEmbed()
|
2022-01-14 00:52:51 +05:00
|
|
|
.setDescription(joke.joke)
|
2022-01-05 00:24:57 +05:00
|
|
|
.setFooter({
|
2022-01-14 00:52:51 +05:00
|
|
|
text: message.translate("fun/joke:FOOTER", {
|
|
|
|
id: joke.id
|
|
|
|
})
|
2022-01-05 00:24:57 +05:00
|
|
|
})
|
|
|
|
.setColor(data.config.embed.color);
|
2022-01-04 02:18:28 +05:00
|
|
|
|
2022-01-05 00:24:57 +05:00
|
|
|
message.channel.send({
|
|
|
|
embeds: [embed]
|
|
|
|
});
|
2022-01-04 02:18:28 +05:00
|
|
|
}
|
2022-01-13 00:26:23 +05:00
|
|
|
}
|
2022-01-04 02:18:28 +05:00
|
|
|
|
|
|
|
module.exports = Joke;
|