JaBa/commands/Fun/8ball.js

31 lines
713 B
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const Command = require("../../base/Command.js");
class Eightball extends Command {
2021-12-26 19:29:37 +05:00
constructor(client) {
2021-12-10 21:39:54 +05:00
super(client, {
name: "8ball",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: ["8b"],
2021-12-10 21:39:54 +05:00
memberPermissions: [],
2021-12-26 19:29:37 +05:00
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
2021-12-10 21:39:54 +05:00
nsfw: false,
ownerOnly: false,
cooldown: 2000
2021-12-10 21:39:54 +05:00
});
}
2021-12-26 19:29:37 +05:00
async run(message, args) {
2021-12-10 21:39:54 +05:00
if (!args[0] || !message.content.endsWith("?")) return message.error("fun/8ball:ERR_QUESTION");
const answerN = this.client.functions.randomNum(1, 19);
2021-12-29 22:45:20 +05:00
const answer = message.translate(`fun/8ball:RESPONSE_${answerN + 1}`);
2021-12-10 21:39:54 +05:00
2022-01-04 00:35:11 +05:00
message.channel.send({
content: answer
});
2021-12-10 21:39:54 +05:00
}
};
module.exports = Eightball;