lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.6k stars 2.28k forks source link

Bots should be able to issue challenges #4771

Closed captncraig closed 5 years ago

captncraig commented 5 years ago

I am trying to use the bot api to integrate a pair of custom physical chess boards so that they can always play against each other. The bot api is the only (legitimate) way I can use to play with them on lichess. The idea is that I and another user will pretty much always have a correspondence game going. There are a couple of drawbacks:

  1. We are restricted to bot accounts, even though we are exclusively making unassisted human moves. I kinda understand this restriction in the context of stopping cheating, but it still feels bad sometimes.
  2. We cannot make new games without going onto the website in a browser. Ideally the board would simply rematch and you can reset and play a new game. The board is raspberry pi based, and designed to run independently without needing user interaction if possible.

My proposal is to dd an api route for a bot issue to issue a challenge. I can forsee a variety of reasons this could be undesirable:

A couple of simple restrictions could help:

Again, my intention is to simply use the bot api to facilitate human vs human games with an alternate client. I do not want to get into reverse engineering websockets and trying to fight anti-cheat mechanisms, and would really like to use the official api if at all possible.

Currently fics is our best option, but lichess has so many more features for looking back at games, analysis and so forth. Is there any possibility to make this work?

ornicar commented 5 years ago

Feature request accepted.

ornicar commented 5 years ago

https://lichess.org/api#operation/challengeCreate

It's not on prod yet, but you can try it out on https://listage.ovh.

It's an OAuth endpoint that is not restricted to bots.