Skip to content

Commit a901d93

Browse files
Update README.md
1 parent da769b7 commit a901d93

1 file changed

Lines changed: 30 additions & 51 deletions

File tree

README.md

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,44 @@
1-
<div align="center">
1+
Environment Setup:
2+
- Clone repo
3+
- Open VSCode and go to the program folder
4+
- Create a venv `python -m venv .venv`
5+
- Enter the venv `.\.venv\Scripts\activate`
6+
- Run `pip install -r requirements.txt`
27

3-
![lichess-bot](https://github.com/lichess-bot-devs/lichess-bot-images/blob/main/lichess-bot-icon-400.png)
8+
Lichess Connection:
9+
- Create an account on [Lichess.org](https://lichess.org/signup?referrer=https%3A%2F%2Flichess.org%2F)
10+
- Hover over your name in top right, then select `Preferences`->`API access tokens`->`Click the blue button top right to create a token, give your token a name (ex: lichess-bot-token), select all the permissions then click `Create`. Save this token to the config.yml under the token key. **Note to set all the option values of the bot to Green to ensure maximum compatibility. Remember to save your token and do NOT share it or hardcode it in your code.**
411

5-
<h1>lichess-bot</h1>
12+
![lichess_pic_2](https://github.com/user-attachments/assets/03492f8e-0ae9-495d-9058-f14cc835c82a)
13+
![lichess_pic_3](https://github.com/user-attachments/assets/db262216-1559-4bbc-ac5e-39b83699bda6)
614

7-
A bridge between [lichess.org](https://lichess.org) and bots.
8-
<br>
9-
<strong>[Explore lichess-bot docs »](https://github.com/lichess-bot-devs/lichess-bot/wiki)</strong>
10-
<br>
11-
<br>
12-
[![Python Build](https://github.com/lichess-bot-devs/lichess-bot/actions/workflows/python-build.yml/badge.svg)](https://github.com/lichess-bot-devs/lichess-bot/actions/workflows/python-build.yml)
13-
[![Python Test](https://github.com/lichess-bot-devs/lichess-bot/actions/workflows/python-test.yml/badge.svg)](https://github.com/lichess-bot-devs/lichess-bot/actions/workflows/python-test.yml)
14-
[![Mypy](https://github.com/lichess-bot-devs/lichess-bot/actions/workflows/mypy.yml/badge.svg)](https://github.com/lichess-bot-devs/lichess-bot/actions/workflows/mypy.yml)
1515

16-
</div>
1716

18-
## Overview
17+
You can run a quick smoke test in a sample python file as in:
1918

20-
[lichess-bot](https://github.com/lichess-bot-devs/lichess-bot) is a free bridge
21-
between the [Lichess Bot API](https://lichess.org/api#tag/Bot) and chess engines.
19+
From the command line:
20+
```export lichess_token = "YOUR_TOKEN"```
2221

23-
With lichess-bot, you can create and operate a bot on lichess. Your bot will be able to play against humans and bots alike, and you will be able to view these games live on lichess.
22+
In a test_token.py file run:
23+
```
24+
TOKEN = os.environ["lichess_token"]
25+
H = {
26+
"Authorization": f"Bearer {TOKEN}",
27+
"Accept": "application/x-ndjson",
28+
}
2429
25-
See also the lichess-bot [documentation](https://github.com/lichess-bot-devs/lichess-bot/wiki) for further usage help.
30+
# Smoke Test for
31+
def smoke_test_token():
32+
global TOKEN
33+
H = {"Authorization": f"Bearer {TOKEN}"}
34+
me = requests.get("https://lichess.org/api/account", headers=H).json()
35+
print("Logged in as:", me["username"])
2636
27-
## Features
28-
Supports:
29-
- Every variant and time control
30-
- UCI, XBoard, and Homemade engines
31-
- Matchmaking (challenging other bots)
32-
- Offering Draws and Resigning
33-
- Participating in tournaments
34-
- Accepting move takeback requests from opponents
35-
- Saving games as PGN
36-
- Local & Online Opening Books
37-
- Local & Online Endgame Tablebases
37+
smoke_test_token()
38+
```
3839

39-
Can run on:
40-
- Python 3.9 and later
41-
- Windows, Linux and MacOS
42-
- Docker
40+
Afterwards see the homemady.py file for sample chess engine classes, for which you will subclass your own, namely from the MinimalEngine class from the LichessBot/lib/engine_wrapper.py file.
4341

44-
## Steps
45-
1. [Install lichess-bot](https://github.com/lichess-bot-devs/lichess-bot/wiki/How-to-Install)
46-
2. [Create a lichess OAuth token](https://github.com/lichess-bot-devs/lichess-bot/wiki/How-to-create-a-Lichess-OAuth-token)
47-
3. [Setup the engine](https://github.com/lichess-bot-devs/lichess-bot/wiki/Setup-the-engine)
48-
4. [Configure lichess-bot](https://github.com/lichess-bot-devs/lichess-bot/wiki/Configure-lichess-bot)
49-
5. [Upgrade to a BOT account](https://github.com/lichess-bot-devs/lichess-bot/wiki/Upgrade-to-a-BOT-account)
50-
6. [Run lichess-bot](https://github.com/lichess-bot-devs/lichess-bot/wiki/How-to-Run-lichess%E2%80%90bot)
51-
52-
## Advanced options
53-
- [Create a homemade engine](https://github.com/lichess-bot-devs/lichess-bot/wiki/Create-a-homemade-engine)
54-
- [Add extra customizations](https://github.com/lichess-bot-devs/lichess-bot/wiki/Extra-customizations)
55-
56-
<br />
57-
58-
## Acknowledgements
59-
Thanks to the Lichess team, especially T. Alexander Lystad and Thibault Duplessis for working with the LeelaChessZero team to get this API up. Thanks to [Niklas Fiekas](https://github.com/niklasf) and his [python-chess](https://github.com/niklasf/python-chess) code which allows engine communication seamlessly.
60-
61-
## License
62-
lichess-bot is licensed under the AGPLv3 (or any later version at your option). Check out the [LICENSE file](https://github.com/lichess-bot-devs/lichess-bot/blob/master/LICENSE) for the full text.
6342

6443
## Citation
6544
If this software has been used for research purposes, please cite it using the "Cite this repository" menu on the right sidebar. For more information, check the [CITATION file](https://github.com/lichess-bot-devs/lichess-bot/blob/master/CITATION.cff).

0 commit comments

Comments
 (0)