Hello! Sorry if this is too specific/niche.
I'm working on a chess bot (melsh_bot), and I'm trying to have it automatically send challenges to other bots, so that it would have a more an accurate rating, so that when I modify my bot, I can just come back after a couple of hours to see how the rating has changed, instead of manually challenging other bots.
The lichess bot code doesn't seem to have code to handle that automatically, so I tried making the function.
I added this to the lichess.py file:
def challenge_user(self, username):
challenge_data = "{'rated':false 'clock.limit':30 'clock.increment':1}"
x = self.api_post(ENDPOINTS["challenge"].format(username), data=challenge_data, headers ={"Content-Type": "application/x-www-form-urlencoded"})
return(x)
and added ENDPOINTS["challenge"] as "/api/challenge/{}"
When testing (by having my bot send a challenge to my human account), this almost works, but for some reason, the time control of the challenge is always set to Unlimited, instead of being 1/2 + 1, which it should be based on the data I sent.
Would anyone know what I'm doing wrong?