lichess-org / api

Lichess API documentation and examples
https://lichess.org/api
GNU Affero General Public License v3.0
417 stars 140 forks source link

Color always "white" when challenging AI #215

Closed campovski closed 1 year ago

campovski commented 1 year ago

Issuing request on https://lichess.org/api/challenge/ai with omitting color parameter, setting it as white, black, or random, always results in returned json receiving "player": "white" instead of the correct color. Opening the actual game in browser sets colors correctly.

Example response to request with "level": 8, "clock.limit": 10800, "clock.increment": 180, "color": "black".

{
    "id": "AlG73JB1",
    "variant": {
        "key": "standard",
        "name": "Standard",
        "short": "Std"
    },
    "speed": "classical",
    "perf": "classical",
    "rated": false,
    "fen": "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
    "player": "white",
    "turns": 0,
    "startedAtTurn": 0,
    "source": "ai",
    "status": {
        "id": 20,
        "name": "started"
    },
    "createdAt": 1668876996569
}

If you check the actual game you can see that I got color black as intended but not stated in response.

campovski commented 1 year ago

Actually, I assume "player" means who is on turn, so closing the issue.