mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
Fix
This commit is contained in:
@@ -27,9 +27,9 @@ module.exports = class MinesweeperCommand extends Command {
|
|||||||
async run(msg, { size }) {
|
async run(msg, { size }) {
|
||||||
const current = this.client.games.get(msg.channel.id);
|
const current = this.client.games.get(msg.channel.id);
|
||||||
if (current) return msg.reply(`Please wait until the current game of \`${current.name}\` is finished.`);
|
if (current) return msg.reply(`Please wait until the current game of \`${current.name}\` is finished.`);
|
||||||
this.client.games.set(msg.channel.id, { name: this.name });
|
|
||||||
try {
|
try {
|
||||||
const game = new BombSweeper(size, size);
|
const game = new BombSweeper(size, size);
|
||||||
|
this.client.games.set(msg.channel.id, { name: this.name, data: game });
|
||||||
game.PlaceBombs(size + 1); // eslint-disable-line new-cap
|
game.PlaceBombs(size + 1); // eslint-disable-line new-cap
|
||||||
let win = null;
|
let win = null;
|
||||||
game.onWin = () => { win = true; };
|
game.onWin = () => { win = true; };
|
||||||
|
|||||||
Reference in New Issue
Block a user