Closed ezhang7423 closed 6 months ago
Digging further, it seems like the code will call /api/stream/event
several times in rapid succession:
https://lichess.org/api/stream/event None 15 True
[04/12/24 08:42:14] INFO Next challenge will be created after 08:43:14 (0 challenges in last 24 hours) matchmaking.py:292
<Response [200]> 200
https://lichess.org/api/stream/event None 15 True
<Response [200]> 200
https://lichess.org/api/stream/event None 15 True
<Response [200]> 200
https://lichess.org/api/stream/event None 15 True
<Response [200]> 200
https://lichess.org/api/stream/event None 15 True
<Response [200]> 200
https://lichess.org/api/stream/event None 15 True
This happened within the course of a second...
Another interesting note...this seems to happen because of a certain API token. When switching to a different API token, there is no issue...
What scopes are on the two API tokens? Go to the API access tokens page in your bot's preferences on lichess to see a list. Label the lists to indicate which one causes problems and which doesn't.
Both API tokens have the correct scopes - the API token that is currently not working was working just a few days ago. If you're open to it, I can DM you privately the API token to debug with.
@ezhang7423 Sure, that will be useful. I'm m.z.h
on the lichess discord server.
Please reopen if the problem persists and you can provide more details.
Describe the bug When running this repository from scratch with no modifications, I am getting this error:
<Response [429]> 429 {"error":"Please don't poll this endpoint, it is intended to be streamed. See https://lichess.org/api#tag/Board/operation/apiStreamEvent."}
Endpoint /api/stream/event is rate limited. Waiting 0:01:00 seconds until next request.
To Reproduce Steps to reproduce the behavior:
python lichess-bot.py
Expected behavior I expect that getting events should be able to succeed.
Logs
old.log recent.log
Desktop (please complete the following information):