mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Either player can forfeit
This commit is contained in:
@@ -84,9 +84,10 @@ module.exports = class ChessCommand extends Command {
|
||||
prevPieces = Object.assign({}, game.exportJson().pieces);
|
||||
const moves = game.moves();
|
||||
const pickFilter = res => {
|
||||
if (res.author.id !== user.id) return false;
|
||||
if (![msg.author.id, opponent.id].includes(res.author.id)) return false;
|
||||
const choice = res.content.toUpperCase();
|
||||
if (choice === 'END') return true;
|
||||
if (res.author.id !== user.id) return false;
|
||||
const move = choice.match(turnRegex);
|
||||
if (!move) return false;
|
||||
if (!moves[move[1]] || !moves[move[1]].includes(move[2])) {
|
||||
|
||||
Reference in New Issue
Block a user