JaBa/commands/Fun/joke.js

35 lines
927 B
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
class Joke extends Command {
constructor (client) {
super(client, {
name: "joke",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: [ "blague" ],
memberPermissions: [],
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
nsfw: false,
ownerOnly: false,
cooldown: 3000
});
}
async run (message, args, data) {
2021-12-18 19:43:06 +05:00
if (!this.client.config.apiKeys.blagueXYZ) return message.error("misc:COMMAND_DISABLED");
2021-12-10 21:39:54 +05:00
// const joke = await this.client.joker.randomJoke(data.guild.language.substr(0, 2));
const joke = await this.client.joker.randomJoke("en");
const embed = new Discord.MessageEmbed()
.setDescription(joke.toDiscordSpoils())
.setFooter(message.translate("fun/joke:FOOTER"))
.setColor(this.client.config.embed.color);
message.channel.send(embed);
}
};
module.exports = Joke;