From 066bf210de1f306d7c73a699348750659bf69249 Mon Sep 17 00:00:00 2001 From: M-307 Date: Mon, 18 Jul 2022 15:54:24 +0700 Subject: [PATCH] Add set_language function --- enkanetwork/client.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/enkanetwork/client.py b/enkanetwork/client.py index b5d4d14..6b3aff7 100644 --- a/enkanetwork/client.py +++ b/enkanetwork/client.py @@ -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)):