-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add matchmaking #473
Add matchmaking #473
Conversation
The bot would crash if there was no matchmaking section in config.yml.
This works pretty well. It'll be nice to have my bot play more games without me having to manually start them. One change to cut down on unnecessary debugging output: In
|
It got this error? Is this normal?
|
Verbose logs:
Might have been caused by this 9d06571 ? |
This wasn't caused by 9d06571. After filtering the bots that didn't have perfs, it turned out that the bots that didn't have perfs were because the accounts were closed. |
This is the error I'm facing now.
|
Can you send more of the logs (both before and after the error message)? |
Sorry, it seems I made a change that caused this and I just fixed it. I was about to comment the fix here and realise it was already fine here. Sorry for the false warning. |
After a while of running matchmaking, I faced this error:
|
Always update self.last_challenge_created to avoid hitting the api rate limits.
Did this happen only once or did it happen multiple times? I can add try:
code
except ConnectionError:
retry But I think that this can be caused by any request, not only the requests that matchmaking makes. I thought that maybe the bot hit the api rate limits and because it continued to make requests, lichess closed the connection. I removed an if statement, so now even if the bot doesn't have a possible opponent, it won't use get_online_bots continuously. |
I think it works fine now, should just make sure not to exceed lichess' API rate limits. Maybe documentation on that somewhere could be useful. |
I was wondering if an option similar to
|
Two things: @TheYoBots What's the difference betweeen challenge timeout and challenge interval? I would like to limit the number of options the user has to think about. @AttackingOrDefending In |
Challenge timeout would be the amount of time to wait after a game is played (this game was not created by the matchmaking option) to start matchmaking. But if this has been covered by challenge interval it could be skipped. |
Increase time between challenges from 10 to 20 seconds.
I believe that waiting 60 seconds isn't useful because I doubt that lichess allows only 1 challenge per minute. I increased it to 20 seconds just to be safe. |
The bot now uses |
@AttackingOrDefending @TheYoBots Any more changes or comments? Is this ready to merge? |
It is ready from me. |
@AttackingOrDefending I've run this PR for more than 3 hours with no apparent problems. Consider this approved. Go ahead and merge this if you're ready. |
Adds matchmaking. The variant is chosen by random from all the supported variants. If
challenge_days
is enabled then the challenge will always be correspondence, even if it is a variant game (e.g. crazyhouse correspondence).closes #472