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

ValueError: The given locale 'en-AE' is invalid. See `valorant.values.LOCALES` for a list of valid locales. #21

Closed ejinbt closed 3 years ago

ejinbt commented 3 years ago

is this problem with module or error in my code , I just copied the example and replaced the API key with mine

frissyn commented 3 years ago

Looks like Riot has added some new regions! This is a problem with the module, I'll fix ASAP, thanks for the issue.

frissyn commented 3 years ago

@EjinJS @Willmidd1 Are you guys passing your own locales to the client like valorant.Client(key, locale="en-AE") or are you just passing a key? Because both of those raise different problems that need different solutions.

frissyn commented 3 years ago

en-AE is not a valid region locale at all. If it's being set automatically then that's a problem that can be solved passing your own locale (a valid one, of course). The closest valid locales to en-AE are en-AU and ar-AE.

It's also important to remember that just because a locale is a valid doesn't mean Riot supports it. You can find a list of Riot supported locales as a variable at valorant.values.LOCALES.

TL;DR You can fix the problem by doing client = valorant.Client(key, locale="en-AU")