Skip to content

Commit

Permalink
docs: add sample code for berserk python client
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Jun 17, 2023
1 parent ebdd4e1 commit 3740535
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions docs/api-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,29 @@ Consider using a lila-gitpod workspace while you develop your API integration be
- Don't worry about messing anything up
- If developing a bot, keep test games out of your bot's game history

## Bot Development
## Setup


1. [Create your workspace](getting-started.md)
2. Create an account for your bot
3. Make port 8080 public, so you can access it from your bot's server
2. [Make port 8080 public](sharing.md), so you can access it from the client.

## Bot Development
3. Create an account for your bot
4. Point your bot to use your workspace's development site instead of `lichess.org`

!!! info "Using lichess-bot"

If you're using the [lichess-bot](https://github.com/ShailChoksi/lichess-bot) project, set the [`url` value in `config.yml`](https://github.com/ShailChoksi/lichess-bot/blob/master/config.yml.default) to your development site.

## Client Development

If you're using the Lichess [berserk](https://github.com/lichess-org/berserk) Python client, you can point it to your workspace's development site instead of `lichess.org`.

```python
import berserk

client = berserk.Client(base_url="https://your-gitpod-instance.gitpod.io")

profile = client.users.get_by_id('bobby')
print(profile)
```

0 comments on commit 3740535

Please sign in to comment.