diff --git a/homemade.py b/homemade.py index 01221be80..107689227 100644 --- a/homemade.py +++ b/homemade.py @@ -2,6 +2,7 @@ import logging import random +import time from enum import Enum from typing import Union, Any, override, cast @@ -70,6 +71,10 @@ def search(self, board: chess.Board, time_limit: chess.engine.Limit, ponder: boo :return: The move to play. """ + # Pause for a little so that any chat messages are processed before the start of the game. + if board.halfmove_clock == 0: + time.sleep(0.5) + time_left, increment = (time_limit.white_clock, time_limit.white_inc) if board.turn == chess.WHITE else ( time_limit.black_clock, time_limit.black_inc) if time_left is None or time_left > 10 or (increment is not None and increment >= 1):