2022-01-01 00:50:09 +05:00
|
|
|
const Command = require("../../base/Command.js"),
|
|
|
|
TTT = require("discord-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) {
|
|
|
|
const game = new TTT({ language: "ru" })
|
|
|
|
game.handleMessage(message);
|
2022-01-01 23:36:48 +05:00
|
|
|
|
|
|
|
this.client.once("win", data => {
|
|
|
|
console.log(data.winner + " wins the TicTacToe game!");
|
|
|
|
console.log(data.loser + " loses the TicTacToe game!");
|
|
|
|
});
|
2022-01-01 00:50:09 +05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = TicTacToe;
|