JaBa/commands/Fun/8ball.js

29 lines
716 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,
2021-12-26 19:29:37 +05:00
aliases: ["eight-ball", "eightball"],
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");
2021-12-29 22:45:20 +05:00
const answerN = this.client.functions.randomNum(1, 20);
const answer = message.translate(`fun/8ball:RESPONSE_${answerN + 1}`);
2021-12-10 21:39:54 +05:00
2021-12-29 22:45:20 +05:00
message.channel.send(answer);
2021-12-10 21:39:54 +05:00
}
};
module.exports = Eightball;