1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
from typing import List import yaml class Config(object): token: str admin_roles: List[int] def __init__(self, **args): self.__dict__.update(args) @classmethod def load(cls, file): with open(file) as f: return cls(**yaml.load(f))