From 84bb0527f715006e37684373ab12d8794806feb8 Mon Sep 17 00:00:00 2001 From: PiR Date: Fri, 27 Oct 2023 18:40:27 +0000 Subject: [PATCH] add level param on CHALLENGES_CREATE (needed for challange the ai https://lichess.org/api#tag/Challenges/operation/challengeAi) --- lichess_client/endpoints/challenges.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lichess_client/endpoints/challenges.py b/lichess_client/endpoints/challenges.py index 0f9a0bd..feb0958 100644 --- a/lichess_client/endpoints/challenges.py +++ b/lichess_client/endpoints/challenges.py @@ -40,7 +40,8 @@ async def create(self, days: int = None, color: 'ColorType' = ColorType.RANDOM, variant: 'VariantTypes' = VariantTypes.STANDARD, - position: str = None) -> 'Response': + position: str = None, + level = None) -> 'Response': """ Challenge someone to play. The targeted player can choose to accept or decline. If the challenge is accepted, you will be notified on the event stream that a new game has started. @@ -108,6 +109,9 @@ async def create(self, if position is not None: data['position'] = position + if level is not None: + data['level'] = level + response = await self._client.request(method=RequestMethods.POST, url=CHALLENGES_CREATE.format(username=username), data=data,