|
@@ -744,6 +744,15 @@ async def chess_board_handler(chess, id):
|
|
|
return [board]
|
|
|
|
|
|
|
|
|
+async def chess_moves_handler(chess, id):
|
|
|
+ try:
|
|
|
+ moves = chess.moves(id)
|
|
|
+ except KeyError:
|
|
|
+ return ["Нет активной игры."]
|
|
|
+
|
|
|
+ return [moves]
|
|
|
+
|
|
|
+
|
|
|
CHESS_COMMANDS = {
|
|
|
"start": (chess_start_handler, "Начать новую игру", 0),
|
|
|
"end": (chess_stop_handler, "Завершить игру", 0),
|
|
@@ -752,6 +761,7 @@ CHESS_COMMANDS = {
|
|
|
"skip": (chess_skip_handler, "Пропустить ход", 0),
|
|
|
"pass": (chess_pass_handler, "Сделать ход вместо вас", 0),
|
|
|
"board": (chess_board_handler, "Показать состояние доски", 0),
|
|
|
+ "moves": (chess_moves_handler, "Показать историю ходов (первый ход - игрока)", 0),
|
|
|
}
|
|
|
|
|
|
|