JaBa/commands/Economy/tictactoe.js

46 lines
989 B
JavaScript
Raw Normal View History

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
2022-06-09 14:59:12 +05:00
}).then(async winner => {
const memberData = await this.client.findOrCreateMember({
id: winner.id,
guildID: message.guild.id
});
2022-01-05 22:04:46 +05:00
const info = {
user: message.translate("economy/transactions:TTT"),
2022-01-05 22:04:46 +05:00
amount: 100,
date: Date.now(),
type: "got"
};
memberData.transactions.push(info);
2022-01-05 22:04:46 +05:00
memberData.money += 100;
memberData.save();
2022-01-01 23:36:48 +05:00
});
}
2022-01-13 00:26:23 +05:00
}
module.exports = TicTacToe;