diff --git a/README.md b/README.md index 8951698..ab22e98 100644 --- a/README.md +++ b/README.md @@ -4,37 +4,36 @@ ## Overview -A simple PvP chess game based on editing a reply markup of a chess board. The board built with callback buttons of an inline-keyboard. Bot uses the [`node-chess`](https://github.com/brozeph/node-chess) package, which is driven by the algebraic notation of moves. +A simple PvP chess game based on inline message and edit a reply markup of a chess board. The board built with callback buttons of inline-keyboard. Bot uses the [`node-chess`](https://github.com/brozeph/node-chess) package, which is driven by the algebraic notation of moves (PGN). #### Features: -- The chess board based on inline keyboard buttons and editing of reply markup. +- Inline query to start the game. - PvP - play with friends. +- Bot works in any group or private chat. - All moves stored in the DB, so you can play a few games simultaneously. +[**Demo**](https://t.me/chessy_bot) (WIP version) + ## Usage -[Demo](https://t.me/chessy_bot) (WIP version). +To play chess simply type `@chessy_bot[SPACE]` to your telegram's message input box. -### Commands +![](img/3.png) -- `/start` - shows a list of available for join games and the `Create new game` button. *It is the default state.* +Then choose a side you want to play with. You will see an inline message with a chess board and a **"Join to game"** at the bottom. -![](img/1.png) +![](img/4.png) -Each list item contains id's of players and completed moves count. The first id is always for a white player. If it is your id, then there will be **`YOU`** word, instead of id. Your turn marker will be shown if the game needs your attention (your turn now). +When someone join your game, this will be displayed in the status message. Also the **"Join to game"** button will become **"Settings"**. -Select the game you need now: +![](img/5.png) -![](img/2.png) +Now everything is ready to start the game. Whites should make the first turn. To move your pieces you should easily select a piece you want to move and then select a destination from displayed available to move squares. -All buttons are clickable and boards will be updated right after you or your opponent had made a turn. The star near a player's id means it is a turn of a side where it placed now. - -#### Buttons: - -- **Back** - return to the list of games -- **Reverse** - *NOT IMPLEMENTED YET* -- **Index** - *NOT IMPLEMENTED YET* +> **WARNING!!!** +> +> The board is rotating each turn by default! The active player always placed at the bottom! ## Install and run own bot instance @@ -46,7 +45,7 @@ cd chessbot npm i ``` -Then you need to create and fill up a new `.env` file: +Then you should create and fill up a new `.env` file: ```bash cp .env.example .env @@ -56,7 +55,7 @@ editor .env Next migrate the DB: ```bash -node_modules/.bin/knex migrate:latest +./node_modules/.bin/knex migrate:latest ``` Then run the dev mode: @@ -78,6 +77,7 @@ Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c6 ## Authors - **Denis Efremov** - *Code|Idea* - [Piterden](https://github.com/Piterden) +- **kolay** *Code|Consulting* - [kolay-v]() ## License diff --git a/img/3.png b/img/3.png new file mode 100644 index 0000000..e6fd1ae Binary files /dev/null and b/img/3.png differ diff --git a/img/4.png b/img/4.png new file mode 100644 index 0000000..c0c5b26 Binary files /dev/null and b/img/4.png differ diff --git a/img/5.png b/img/5.png new file mode 100644 index 0000000..cc34b02 Binary files /dev/null and b/img/5.png differ