mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Fix
This commit is contained in:
@@ -37,12 +37,12 @@ module.exports = class MinesweeperCommand extends Command {
|
|||||||
game.onLose = () => { win = false; };
|
game.onLose = () => { win = false; };
|
||||||
while (!win) {
|
while (!win) {
|
||||||
await msg.say(stripIndents`
|
await msg.say(stripIndents`
|
||||||
${user}, what coordinates do you pick (ex. 4,5)? Type \`end\` to forefeit.
|
${msg.author}, what coordinates do you pick (ex. 4,5)? Type \`end\` to forefeit.
|
||||||
|
|
||||||
${this.displayBoard(game.board, game.mask)}
|
${this.displayBoard(game.board, game.mask)}
|
||||||
`);
|
`);
|
||||||
const filter = res => {
|
const filter = res => {
|
||||||
if (res.author.id !== user.id) return false;
|
if (res.author.id !== msg.author.id) return false;
|
||||||
const pick = res.content;
|
const pick = res.content;
|
||||||
if (pick.toLowerCase() === 'end') return true;
|
if (pick.toLowerCase() === 'end') return true;
|
||||||
const coordPicked = pick.match(/(\d), ?(\d)/i);
|
const coordPicked = pick.match(/(\d), ?(\d)/i);
|
||||||
@@ -62,7 +62,7 @@ module.exports = class MinesweeperCommand extends Command {
|
|||||||
}
|
}
|
||||||
const choice = turn.first().content;
|
const choice = turn.first().content;
|
||||||
if (choice.toLowerCase() === 'end') {
|
if (choice.toLowerCase() === 'end') {
|
||||||
winner = userTurn ? opponent : msg.author;
|
win = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const coordPicked = choice.match(/(\d), ?(\d)/i)
|
const coordPicked = choice.match(/(\d), ?(\d)/i)
|
||||||
|
|||||||
Reference in New Issue
Block a user