mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 21:24:59 +05:00
46 lines
989 B
JavaScript
46 lines
989 B
JavaScript
|
const Command = require("../../base/Command"),
|
||
|
tictactoe = require("../../helpers/tictactoe");
|
||
|
|
||
|
class TicTacToe extends Command {
|
||
|
constructor(client) {
|
||
|
super(client, {
|
||
|
name: "tictactoe",
|
||
|
dirname: __dirname,
|
||
|
enabled: true,
|
||
|
guildOnly: false,
|
||
|
aliases: ["ttt"],
|
||
|
memberPermissions: [],
|
||
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
||
|
nsfw: false,
|
||
|
ownerOnly: false,
|
||
|
cooldown: 2000
|
||
|
});
|
||
|
}
|
||
|
|
||
|
async run(message, args, data) {
|
||
|
tictactoe(message, {
|
||
|
resultBtn: true,
|
||
|
embedColor: data.config.embed.color,
|
||
|
embedFoot: data.config.embed.footer
|
||
|
}).then(async winner => {
|
||
|
const memberData = await this.client.findOrCreateMember({
|
||
|
id: winner.id,
|
||
|
guildID: message.guild.id
|
||
|
});
|
||
|
|
||
|
const info = {
|
||
|
user: message.translate("economy/transactions:TTT"),
|
||
|
amount: 100,
|
||
|
date: Date.now(),
|
||
|
type: "got"
|
||
|
};
|
||
|
|
||
|
memberData.transactions.push(info);
|
||
|
|
||
|
memberData.money += 100;
|
||
|
memberData.save();
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = TicTacToe;
|