Show FEN in chess

This commit is contained in:
Dragon Fire
2021-02-13 18:07:12 -05:00
parent 4700e295b8
commit 8cc185834a
+2
View File
@@ -1,4 +1,5 @@
const Command = require('../../structures/Command');
const { escapeMarkdown } = require('discord.js');
const jsChess = require('js-chess-engine');
const { createCanvas, loadImage } = require('canvas');
const moment = require('moment');
@@ -126,6 +127,7 @@ module.exports = class ChessCommand extends Command {
_You are ${gameState.check ? '**in check!**' : 'not in check.'}_
**Time Remaining: ${displayTime}** (Max 10min per turn)
**FEN:** ${escapeMarkdown(game.exportFEN())}
`, { files: [{ attachment: this.displayBoard(gameState, prevPieces), name: 'chess.png' }] });
prevPieces = Object.assign({}, game.exportJson().pieces);
const moves = game.moves();