Updated readme

This commit is contained in:
Piterden
2019-05-05 02:44:44 +03:00
parent 05f62129ef
commit 3366760c0e
4 changed files with 18 additions and 18 deletions
+18 -18
View File
@@ -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](<https://github.com/kolay-v>)
## License
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB