Closed jrwaine closed 4 years ago
Can you please explain more about the use case?
I am making a bot to play chess using Twitch chat, so I upgraded my account to a Bot and use the board endpoints to make moves.
The problem is that there is no available endpoints to search games for bot accounts (except Challenge, but a username must be provided).
The only reliable opponent I found was Lichess Stockfish, but since there are no endpoint to create a game with it, every time a game ends I have to manually start another game against Stockfish. Permitting the setup/ai to accept Bearer token authorization would allow to automate that.
I tried to use the endpoint and it returns a created game as expected, but the game against AI is not created. The game ID redirects to an usual challenge link.
It's not deployed yet.
Ok, please let me know when it is deployed.
done
I am trying to automate the creation of a game against computer, but investigating the berserk no function for that was available.
So by investigating the source code, I found the endpoint to setup/ai, which opens the page for a new game for GET and uses the parameters to send a POST to the same endpoint.
The problem is that for creating a new game against the computer with a user, it is necessary to login. I could only create a new game for my user by passing a cookie in the header of the request.
I believe a more secure way to do this is to allow the user to pass the token as a header for authorization. This way a function in berserk for creating a game against the computer can be created as well.