mirror of
https://github.com/PaiGramTeam/EnkaNetwork.py.git
synced 2024-11-16 03:45:28 +00:00
Add character_ids variable
This commit is contained in:
parent
abc068c5d6
commit
66c1cb8bf9
@ -2,7 +2,7 @@ import json
|
||||
import os
|
||||
import logging
|
||||
|
||||
from typing import Dict, Union
|
||||
from typing import Dict, Union, List
|
||||
from io import TextIOWrapper
|
||||
|
||||
from .enum import Language
|
||||
@ -30,6 +30,10 @@ class Assets:
|
||||
cls.__load_assets_lang()
|
||||
cls.__load_assets_data()
|
||||
|
||||
@property
|
||||
def CHARACTERS_IDS(self) -> List[str]:
|
||||
return [x for x in self.DATA["characters"]]
|
||||
|
||||
@classmethod
|
||||
def character(cls, id: int) -> Union[assets.CharacterAsset, None]:
|
||||
LOGGER.debug(f"Getting character assets with id: {id}")
|
||||
@ -123,7 +127,7 @@ class Assets:
|
||||
@classmethod
|
||||
def _set_language(cls, lang: Language) -> None:
|
||||
# Check language
|
||||
if not lang.split("-")[0].lower() in list(Language):
|
||||
if lang is None or not lang.split("-")[0].lower() in list(Language):
|
||||
raise ValueError("Language not supported. Please check your language.") # noqa: E501
|
||||
|
||||
LOGGER.debug(f"Set language to {lang}.")
|
||||
|
Loading…
Reference in New Issue
Block a user