rhgrant10 / berserk

Python client for the lichess API
https://berserk.readthedocs.io
Other
141 stars 36 forks source link

export_by_player incorrect work of a boolean argument rated #26

Open extroot opened 3 years ago

extroot commented 3 years ago

Description

The function rated contains the boolean parameter rated, which takes the values True for rated games and False for casual games. But if you pass this argument as True/False, as the documentation says, then only casual games will be obtained. This parameter will work correctly only if you pass the string value "true"/"false".

What I Did

import berserk
token = 'TOKEN'
session = berserk.TokenSession(token)
client = berserk.Client(session=session)

client.games.export_by_player(username='USERNAME', max=1, rated=True)  # {..., 'rated': False, ...}
client.games.export_by_player(username='USERNAME', max=1, rated='true')  # {..., 'rated': True, ...}
Virinas-code commented 2 years ago

I fix it in #38