A chat bot that allows users to play chess via a messaging platform.
- Python 3.x
- pyTelegramBotAPI - A simple, but extensible Python implementation for the Telegram Bot API
- python-chess: a chess library for Python
- pgn2gif
- Create a bot and obtain its API token by talking to the Bot Father on Telegram.
- Clone the repository and navigate to the directory:
git clone https://github.com/menisadi/ChessBot.git cd ChessBot
- Create a file named
token.txt
and paste in it your API token. - Run the script:
python3 bot.py
- Start a conversation with the bot and use the following commands to play chess:
/start
- start a new game<move>
- make a move on the chess board (in standard algebraic notation e.g.e4
,Nxe4
,a8=Q
)/moves
- show a list of legal move/resign
- resign from the current game/stockfish
- Play against Stockfish engine (add a number [0-20] to limit its strength). binary file of Stockfish is not included so you need to download it and add to your local folder/random
- Bot will make random moves/show
- show the board/pgn
- print the entire game in PGN format
- The bot supports one game at a time per user
- The bot has been tested on Python 3.10. It may work on other versions of Python, but this has not been tested.
This project is licensed under GNU GPL v3 License - see the LICENSE file for details.