Skip to content

Commit 06bb46f

Browse files
authored
Document settings affecting daily game limit usage (#1140)
* Warn user about daily bot game limit If the `matchmaking: challenge_timeout` would allow more than 100 games per day, warn the user. * Document settings affecting daily game limit usage * Fix spelling of configuration; clear up reasong
1 parent 291f0f7 commit 06bb46f

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

lib/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from abc import ABCMeta
99
from typing import Any, Union, ItemsView, Callable
1010
from lib.lichess_types import CONFIG_DICT_TYPE, FilterType
11+
from lib.timer import minutes, days
1112

1213
logger = logging.getLogger(__name__)
1314

@@ -342,6 +343,11 @@ def validate_config(CONFIG: CONFIG_DICT_TYPE) -> None:
342343
"no challenges being created.")
343344
config_warn(matchmaking.get("opponent_rating_difference", 0) >= 0,
344345
"matchmaking.opponent_rating_difference < 0 will result in no challenges being created.")
346+
max_games_per_day = 100
347+
game_timeout = minutes(matchmaking["challenge_timeout"])
348+
config_warn(game_timeout*max_games_per_day >= days(1),
349+
f"A bot is only allowed to play {max_games_per_day} games per day against other bots. Please check your "
350+
"config file to make sure your bot won't use up all its allotted games quickly.")
345351

346352
pgn_directory = CONFIG["pgn_directory"]
347353
in_docker = os.environ.get("LICHESS_BOT_DOCKER")

wiki/Configure-lichess-bot.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Configuring lichess-bot
22
There are many possible options within `config.yml` for configuring lichess-bot.
33

4+
## Note on daily game limits
5+
6+
Lichess allows a bot to play 100 games against other bots in a single day (games against humans are unlimited). Several settings below can influence how quickly this game allowance is used up. These include the following:
7+
- `challenge:`
8+
- `concurrency`: Playing multiple simultaneous games will use up games faster.
9+
- `accept_bot` and `only_bot`: Games against other bots use up the allotted games.
10+
- `min_increment`, `min_base`, and `time_controls`: Shorter games use up the allotted games faster.
11+
- `recent_bot_challenge_age`, `max_recent_bot_challenges`, `max_simultaneous_games_per_user`: To prevent a single bot from using up all your bot's games.
12+
- `matchmaking:`
13+
- `allow_during_games`: Starting simultaneous games uses up games faster.
14+
- `challenge_timeout`: Longer timeouts between games will spread out games over a day.
15+
- `challenge_initial_time` and `challenge_increment`: Shorter games use up the allotted games faster.
16+
417
## Engine options
518
- `interpreter`: Specify whether your engine requires an interpreter to run (e.g. `java`, `python`).
619
- `interpreter_options`: A list of options passed to the interpreter (e.g. `-jar` for `java`).

0 commit comments

Comments
 (0)