Skip to content

Commit

Permalink
Fix automatic challenge challeging itself
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticXWolf committed Feb 23, 2021
1 parent 3599a50 commit aeddd83
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lichess-bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def start(li, user_profile, engine_factory, config):
control_queue = manager.Queue()
bots_list = manager.list()
load_bots_stream = multiprocessing.Process(
target=load_bot_list, args=[li, bots_list]
target=load_bot_list, args=[li, bots_list, user_profile]
)
load_bots_stream.start()
logger.info(
Expand Down Expand Up @@ -633,13 +633,17 @@ def update_board(board, move):
return board


def load_bot_list(li, bots) -> list:
def load_bot_list(li, bots, user_profile) -> list:
teams = ["lichess-bots"]
logger.info(f"+++ Loading bots from groups {teams}")
for team in teams:
players = li.get_team_members(team)
for player in players:
if "title" in player and player["title"] == "BOT":
if (
"title" in player
and player["title"] == "BOT"
and player["id"] != user_profile["id"]
):
bots.append(player["username"])

logger.info(f"+++ Loaded bots {len(bots)}.")
Expand Down

0 comments on commit aeddd83

Please sign in to comment.