Thanks for creating this project! It made it super easy to set up my bot and now it already played more than 2000 games on Lichess. :star_struck:
I also extended the code to tweak it to my needs and I think some features could be useful to others as well: https://github.com/ShailChoksi/lichess-bot/compare/master...mheinzel:lichess-bot:master
Before opening a bunch of PRs, I wanted to ask you whether you want them in the first place. At the moment, the changes are kind of intertwined and specific to my needs, but I'd be happy to open separate PRs for each feature you want, make changes you deem useful and also add some documentation.
Explicitly handle hitting the rate limit for the challenge API (HTTP 429)
There was something about the code about not raising an exception no unsuccessful API calls, but then the response didn't contain any JSON, so it ended with a stack trace, requiring to restart the bot. This is now handled more explicitly (although there is still room for improvement I think) and receiving a 429 will lead to a 1h matchmaking pause, after which matchmaking resumes.
Add challenge blocklist, allowing to exclude opponents from matchmaking
Some bots didn't accept my challenges for various reasons (e.g. they only play humans, (un)rated, specific time controls or variants), so the bot often needed 2-3 challenges to play a game. This quickly depleted the allowed 400 challenges/day. To avoid this, I checked the logs after a day or two and manually added some opponents to the blocklist. This helped a lot.
Do not challenge bots with 0 games in this game type/variant
This does not make the previous feature obsolete, but in many cases where bots only play e.g. bullet and blitz, they won't have any rapid and classical games. Or an antichess bot had no regular chess games at all. Not challenging them in these cases reduced my blocklist quite a bit. Seems useful to me, but maybe there should be a way to turn it off in the config?
Do not challenge bots that violated the Terms of Service
As I understand, you don't get rating from them anyways? I wanted to exclude them, but this could be turned into a config flag as well.
A few small changes to documentation and what is logged.
Hi!
Thanks for creating this project! It made it super easy to set up my bot and now it already played more than 2000 games on Lichess. :star_struck:
I also extended the code to tweak it to my needs and I think some features could be useful to others as well: https://github.com/ShailChoksi/lichess-bot/compare/master...mheinzel:lichess-bot:master Before opening a bunch of PRs, I wanted to ask you whether you want them in the first place. At the moment, the changes are kind of intertwined and specific to my needs, but I'd be happy to open separate PRs for each feature you want, make changes you deem useful and also add some documentation.
What I implemented:
Which of these are you interested in?