Skip to content

Commit

Permalink
Merge pull request #174 from chesslablab/issue/147-Document-the-accep…
Browse files Browse the repository at this point in the history
…t-command

Issue/147 document the accept command
  • Loading branch information
jbassagana authored Sep 11, 2023
2 parents 56f0779 + c45ff65 commit f5d372e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
33 changes: 33 additions & 0 deletions docs/accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# /accept

## Description

Accepts an invitation code to play chess online with an opponent.

## Parameters

| Name | Description | Required |
| ---- | ----------- | -------- |
| hash | The unique hash of the game. | Yes |

## Usage

### Example

```js
ws.send('/accept 15f78c0035a719491b89522b4905a490');
```

```text
{
"/accept": {
"jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJwY2hlc3MubmV0IiwiaWF0IjoxNjk0NDQxOTcxLCJleHAiOjE2OTQ0NDU1NzEsInZhcmlhbnQiOiJjbGFzc2ljYWwiLCJzdWJtb2RlIjoiZnJpZW5kIiwiY29sb3IiOiJ3IiwibWluIjo1LCJpbmNyZW1lbnQiOjMsImZlbiI6InJuYnFrYm5yL3BwcHBwcHBwLzgvOC84LzgvUFBQUFBQUFAvUk5CUUtCTlIgdyBLUWtxIC0ifQ.POuK_cR3U_bblLa8LFyGg1AJEE5_iW_AquuNn7K4qHI",
"hash": "15f78c0035a719491b89522b4905a490",
"timer": {
"w": 300,
"b": 300
},
"startedAt": 1694441992
}
}
```
2 changes: 1 addition & 1 deletion docs/restart.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Allows to restart an existing game.

## Usage

### Restart a game
### Example

```js
ws.send('/restart ffc536a8f44fc21b4d254e4fb85d7e33');
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ pages:
- /play_lan: play-lan.md
- /heuristics: heuristics.md
- /undo: undo.md
- /accept: accept.md
- /restart: restart.md
theme: readthedocs

0 comments on commit f5d372e

Please # to comment.