🏗️ change code structure

This commit is contained in:
yanyongyu
2021-11-16 18:30:16 +08:00
parent d1c6eeb6c2
commit 4cbdd726e5
19 changed files with 276 additions and 226 deletions

View File

@ -55,16 +55,6 @@ class Bot(abc.ABC):
def __getattr__(self, name: str) -> _ApiCall:
return partial(self.call_api, name)
@classmethod
def __get_validators__(cls):
yield cls.validate
@classmethod
def validate(cls, v):
if not isinstance(v, cls):
raise TypeError(f"{v} is not an instance of {cls}")
return v
@property
@abc.abstractmethod
def type(self) -> str: