diff --git a/config.yml.default b/config.yml.default index c3f4d2fc5..5e556face 100644 --- a/config.yml.default +++ b/config.yml.default @@ -206,6 +206,7 @@ matchmaking: # block_list: # The list of bots that will not be challenged # - user1 # - user2 + include_challenge_block_list: false # Do not challenge bots in the challenge: block_list in addition to the matchmaking block list. # overrides: # List of overrides for the matchmaking specifications above. When a challenge is created, either the default specification above or one of the overrides will be randomly chosen. # bullet_only_horde: # Name of the override. Can be anything as long as each override has a unique name ("bullet_only_horde" and "easy_chess960" in these examples). diff --git a/lib/config.py b/lib/config.py index 3f39c2cf4..ea093d0f3 100644 --- a/lib/config.py +++ b/lib/config.py @@ -212,6 +212,7 @@ def insert_default_values(CONFIG: CONFIG_DICT_TYPE) -> None: set_config_default(CONFIG, "matchmaking", key="challenge_timeout", default=30, force_empty_values=True) CONFIG["matchmaking"]["challenge_timeout"] = max(CONFIG["matchmaking"]["challenge_timeout"], 1) set_config_default(CONFIG, "matchmaking", key="block_list", default=[], force_empty_values=True) + set_config_default(CONFIG, "matchmaking", key="include_challenge_block_list", default=False, force_empty_values=True) default_filter = (CONFIG.get("matchmaking") or {}).get("delay_after_decline") or FilterType.NONE.value set_config_default(CONFIG, "matchmaking", key="challenge_filter", default=default_filter, force_empty_values=True) set_config_default(CONFIG, "matchmaking", key="allow_matchmaking", default=False) @@ -242,6 +243,9 @@ def insert_default_values(CONFIG: CONFIG_DICT_TYPE) -> None: for target in ["", "_spectators"]: set_config_default(CONFIG, "greeting", key=type + target, default="", force_empty_values=True) + if CONFIG["matchmaking"]["include_challenge_block_list"]: + CONFIG["matchmaking"]["block_list"].extend(CONFIG["challenge"]["block_list"]) + def log_config(CONFIG: CONFIG_DICT_TYPE) -> None: """ diff --git a/wiki/Configure-lichess-bot.md b/wiki/Configure-lichess-bot.md index 84e5c861c..5fe992205 100644 --- a/wiki/Configure-lichess-bot.md +++ b/wiki/Configure-lichess-bot.md @@ -249,6 +249,7 @@ will precede the `go` command to start thinking with `sd 5`. The other `go_comma The `challenge_filter` option can be useful if your matchmaking settings result in a lot of declined challenges. The bots that accept challenges will be challenged more often than those that have declined. The filter will remain until lichess-bot quits or the connection with lichess.org is reset. - `block_list`: An indented list of usernames of bots that will not be challenged. If this option is not present, then the list is considered empty. + - `include_challenge_block_list`: If `true`, do not send challenges to the bots listed in the `challenge: block_list`. Default is `false`. - `overrides`: Create variations on the matchmaking settings above for more specific circumstances. If there are any subsections under `overrides`, the settings below that will override the settings in the matchmaking section. Any settings that do not appear will be taken from the settings above.

The overrides section must have the following: - Name: A unique name must be given for each override. In the example configuration below, `easy_chess960` and `no_pressure_correspondence` are arbitrary strings to name the subsections and they are unique.