frissyn / valorant.py

Complete Python interface for the Valorant API. Works right out of the box!
https://valorantpy.readthedocs.io
MIT License
125 stars 19 forks source link

Client() constructor results in 400 error if no locale is specified #47

Open nocturnalong opened 11 months ago

nocturnalong commented 11 months ago

Issue: When using the Client() constructor without specifying a locale, the underlying request to the Riot API results in a 400 error. It seems the Riot API expects a locale parameter, and not having one causes this error.

Steps to Reproduce:

  1. Initialize the client without specifying a locale:
    client = valorant.Client(YOUR_API_KEY)
  2. Observe the 400 error.

Expected Behavior: The library should either provide a default locale (if applicable) or raise a more descriptive error guiding the user to provide the necessary locale parameter.

Temporary Workaround: Specifying locale=None when initializing the client appears to prevent this error:

client = valorant.Client(YOUR_API_KEY, locale=None)

Code_iRegNhVT3w

frissyn commented 11 months ago

Thanks for opening an issue. This might be a more recent change to their API endpoints because this has never raised any errors before. I'll look into this later tonight and get back to you.