mirror of
https://github.com/PaiGramTeam/EnkaNetwork.py.git
synced 2024-11-16 11:52:18 +00:00
Add set_language function
This commit is contained in:
parent
028fc1eab6
commit
066bf210de
@ -8,6 +8,7 @@ from .model import EnkaNetworkResponse
|
||||
from .exception import VaildateUIDError, UIDNotFounded
|
||||
from .assets import Assets
|
||||
from .utils import create_path, validate_uid, request
|
||||
from .enum import Language
|
||||
|
||||
class EnkaNetworkAPI:
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
@ -26,6 +27,17 @@ class EnkaNetworkAPI:
|
||||
# Key
|
||||
self.__key = key
|
||||
|
||||
@property
|
||||
def lang(self) -> Language:
|
||||
return self.assets.LANGS
|
||||
|
||||
@lang.setter
|
||||
def lang(self, lang: Language) -> None:
|
||||
self.assets._set_language(lang)
|
||||
|
||||
async def set_language(self, lang: Language) -> None:
|
||||
self.lang = lang
|
||||
|
||||
async def fetch_user(self, uid: Union[str, int]) -> EnkaNetworkResponse:
|
||||
self.LOGGER.debug(f"Validating with UID {uid}...")
|
||||
if not validate_uid(str(uid)):
|
||||
|
Loading…
Reference in New Issue
Block a user