Skip to content

fix: skip random challenge when no bot is found#1210

Open
ilAYAli wants to merge 1 commit into
lichess-bot-devs:masterfrom
ilAYAli:fix/no-none-challenge
Open

fix: skip random challenge when no bot is found#1210
ilAYAli wants to merge 1 commit into
lichess-bot-devs:masterfrom
ilAYAli:fix/no-none-challenge

Conversation

@ilAYAli
Copy link
Copy Markdown

@ilAYAli ilAYAli commented May 26, 2026

Return immediately when matchmaking cannot pick an opponent, avoiding the misleading 'Will challenge None' log line.

Validation: python3 -m py_compile lichess-bot/lib/matchmaking.py

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

When random matchmaking finds no suitable online bot, choose_opponent() returns no username. The
caller already avoids creating a challenge in that case, but it still logs Will challenge None for a standard game.

This change returns immediately when no opponent was selected, clears the stored challenge id, and logs
that no challenge will be created.

Related Issues:

[Reference any related issues that this pull request addresses or closes. Use the syntax Closes #issue_number to automatically close the linked issue upon merging.]

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

ERROR    No suitable bots found to challenge.
INFO     Will challenge None for a standard game.

After:

ERROR    No suitable bots found to challenge.
INFO     No challenge will be created.

Return immediately when matchmaking cannot pick an opponent, avoiding the misleading 'Will challenge None' log line.

Validation: python3 -m py_compile lichess-bot/lib/matchmaking.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant