Skip to content

Commit d6d4ab4

Browse files
Bots that are disabled or have tos violation aren't shown anymore (#1103)
1 parent 833c44f commit d6d4ab4

File tree

5 files changed

+0
-9
lines changed

5 files changed

+0
-9
lines changed

config.yml.default

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ matchmaking:
205205
# opponent_max_rating: 4000 # Opponents rating should be below this value (4000 is the maximum rating in lichess).
206206
opponent_rating_difference: 300 # The maximum difference in rating between the bot's rating and opponent's rating.
207207
rating_preference: "none" # One of "none", "high", "low".
208-
opponent_allow_tos_violation: false # Set to 'true' to allow challenging bots that violated the Lichess Terms of Service.
209208
challenge_mode: "random" # Set it to the mode in which challenges are sent. Possible options are 'casual', 'rated' and 'random'.
210209
challenge_filter: none # If a bot declines a challenge, do not issue a similar challenge to that bot. Possible options are 'none', 'coarse', and 'fine'.
211210
# block_list: # The list of bots that will not be challenged

lib/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ def insert_default_values(CONFIG: CONFIG_DICT_TYPE) -> None:
230230
set_config_default(CONFIG, "matchmaking", key="opponent_min_rating", default=600, force_empty_values=True)
231231
set_config_default(CONFIG, "matchmaking", key="opponent_max_rating", default=4000, force_empty_values=True)
232232
set_config_default(CONFIG, "matchmaking", key="rating_preference", default="none")
233-
set_config_default(CONFIG, "matchmaking", key="opponent_allow_tos_violation", default=True)
234233
set_config_default(CONFIG, "matchmaking", key="challenge_variant", default="random")
235234
set_config_default(CONFIG, "matchmaking", key="challenge_mode", default="random")
236235
set_config_default(CONFIG, "matchmaking", key="overrides", default={}, force_empty_values=True)

lib/lichess_types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ class UserProfileType(TypedDict, total=False):
5656
username: str
5757
perfs: dict[str, PerfType]
5858
createdAt: int
59-
disabled: bool
60-
tosViolation: bool
6159
profile: ProfileType
6260
seenAt: int
6361
patron: int

lib/matchmaking.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,11 @@ def choose_opponent(self) -> tuple[Optional[str], int, int, int, str, str]:
199199
min_rating = bot_rating - rating_diff
200200
max_rating = bot_rating + rating_diff
201201
logger.info(f"Seeking {game_type} game with opponent rating in [{min_rating}, {max_rating}] ...")
202-
allow_tos_violation = match_config.opponent_allow_tos_violation
203202

204203
def is_suitable_opponent(bot: UserProfileType) -> bool:
205204
perf = bot.get("perfs", {}).get(game_type, {})
206205
return (bot["username"] != self.username()
207206
and not self.in_block_list(bot["username"])
208-
and not bot.get("disabled")
209-
and (allow_tos_violation or not bot.get("tosViolation")) # Terms of Service violation.
210207
and perf.get("games", 0) > 0
211208
and min_rating <= perf.get("rating", 0) <= max_rating)
212209

wiki/Configure-lichess-bot.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ will precede the `go` command to start thinking with `sd 5`. The other `go_comma
246246
- `opponent_max_rating`: The maximum rating of the opponent bot. The maximum rating in lichess is 4000.
247247
- `opponent_rating_difference`: The maximum difference between the bot's rating and the opponent bot's rating.
248248
- `rating_preference`: Whether the bot should prefer challenging high or low rated players, or have no preference.
249-
- `opponent_allow_tos_violation`: Whether to challenge bots that violated Lichess Terms of Service. Note that even rated games against them will not affect ratings.
250249
- `challenge_mode`: Possible options are `casual`, `rated` and `random`.
251250
- `challenge_filter`: Whether and how to prevent challenging a bot after that bot declines a challenge. Options are `none`, `coarse`, and `fine`.
252251
- `none` does not prevent challenging a bot that declined a challenge.
@@ -285,7 +284,6 @@ matchmaking:
285284
# opponent_min_rating: 600
286285
# opponent_max_rating: 4000
287286
opponent_rating_difference: 100
288-
opponent_allow_tos_violation: true
289287
challenge_mode: "random"
290288
challenge_filter: none
291289
overrides:

0 commit comments

Comments
 (0)