|
@@ -809,6 +809,9 @@ async def chess_board_handler(chess, id):
|
|
if chess.is_check(id):
|
|
if chess.is_check(id):
|
|
reply.append("Шах!")
|
|
reply.append("Шах!")
|
|
|
|
|
|
|
|
+ if isinstance(id, str):
|
|
|
|
+ reply.append(f"Ход {'белых' if chess.turn(id) else 'чёрных'}.")
|
|
|
|
+
|
|
return reply
|
|
return reply
|
|
|
|
|
|
|
|
|
|
@@ -818,6 +821,9 @@ async def chess_moves_handler(chess, id):
|
|
except KeyError:
|
|
except KeyError:
|
|
return ["Нет активной игры."]
|
|
return ["Нет активной игры."]
|
|
|
|
|
|
|
|
+ if isinstance(id, str):
|
|
|
|
+ text += f"\nХод {'белых' if chess.turn(id) else 'чёрных'}."
|
|
|
|
+
|
|
return [text]
|
|
return [text]
|
|
|
|
|
|
|
|
|
|
@@ -865,7 +871,7 @@ async def chess_handler(bot, event, command):
|
|
|
|
|
|
return
|
|
return
|
|
|
|
|
|
- name = command.args[0]
|
|
|
|
|
|
+ name = command.args[0].lower()
|
|
if name in CHESS_ALIASES:
|
|
if name in CHESS_ALIASES:
|
|
name = CHESS_ALIASES[name]
|
|
name = CHESS_ALIASES[name]
|
|
elif name not in CHESS_COMMANDS:
|
|
elif name not in CHESS_COMMANDS:
|
|
@@ -909,6 +915,9 @@ async def chess_handler(bot, event, command):
|
|
else:
|
|
else:
|
|
await event.reply(reply)
|
|
await event.reply(reply)
|
|
|
|
|
|
|
|
+ if name in ("move", "skip", "undo", "pass") and peer_id in bot.chess.sessions:
|
|
|
|
+ await event.reply(f"Ход {'белых' if bot.chess.turn(peer_id) else 'чёрных'}.")
|
|
|
|
+
|
|
|
|
|
|
_chess_handler = Handler(chess_handler, is_public=True)
|
|
_chess_handler = Handler(chess_handler, is_public=True)
|
|
|
|
|