Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shows match winner or draw in the
Select a gamemodal for both chesscom and lichess.Chesscom API returns
stalemateif match is drawn in player's object, otherwisewinin result field of winner's object andresigned,checkmatedetc in losers result field.{ ... "white": { "rating": 312, "result": "stalemate", "@id": "https://api.chess.com/pub/player/heidelwurst", "username": "Heidelwurst", "uuid": "01991e62-f3cc-11eb-872b-f70fdab2764c" }, "black": { "rating": 457, "result": "stalemate", "@id": "https://api.chess.com/pub/player/kaushik23456", "username": "kaushik23456", "uuid": "12466a44-b4c9-11ec-ba0a-299867be4d7a" } ... }{ ... "white": { "rating": 232, "result": "checkmated", "@id": "https://api.chess.com/pub/player/shivamkapapa", "username": "SHIVAMKAPAPA", "uuid": "e338e8d4-d596-11ea-ba27-830062a3c426" }, "black": { "rating": 440, "result": "win", "@id": "https://api.chess.com/pub/player/kaushik23456", "username": "kaushik23456", "uuid": "12466a44-b4c9-11ec-ba0a-299867be4d7a" } ... }Lichess API returns
statusasdrawwhen match is drawn. When there is a winner it returns color inwinnerfield of the game.{ ... "status": "draw", "players": { "white": { "user": { "name": "SindarovGM", "title": "GM", "id": "sindarovgm" }, "rating": 3224, "ratingDiff": -3 }, "black": { "user": { "name": "Andrey11976", "title": "NM", "id": "andrey11976" }, "rating": 3077, "ratingDiff": 2 } } ... }{ ... "status": "mate", "players": { "white": { "user": { "name": "Heisenberg01", "title": "FM", "id": "heisenberg01" }, "rating": 3129, "ratingDiff": -4 }, "black": { "user": { "name": "SindarovGM", "title": "GM", "id": "sindarovgm" }, "rating": 3221, "ratingDiff": 6 } }, "winner": "black" ... }chesscom

lichess
