WandererXII / lishogi

☗ lishogi.org: the forever free, adless and open source shogi server forked from lichess.org ☗
https://lishogi.org
GNU Affero General Public License v3.0
266 stars 40 forks source link

API: add a way to create "half-open-ended" challenges #870

Open Pikrass opened 7 hours ago

Pikrass commented 7 hours ago

The API allows us to create either a completely open-ended challenge, where the link needs to be followed by two players to start the game, or a completely defined challenge, where both players are known ahead of time.

I want to create a challenge link that is already accepted by one side. Same as when I click on "Play with a friend" on the Lishogi front page.

I thought I could do this by first creating an open-ended challenge, then immediately accept it with an OAuth2 token. Unfortunately, this fails with a "Not found" error. I guess this endpoint only works for challenges that are explicitly targeted to the logged-in player.

Either the accept endpoint should work for open-ended challenges as well, or a new endpoint should be made to create a half-open challenge.

ddugovic commented 2 hours ago

I know the PyChess community does the reverse (when a game seek is created, send a Discord webhook notification so players can discover that someone is seeking a game).