import traceback from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC from cpl_core.console import Console class PermissionSettings(ConfigurationModelABC): def __init__(self): ConfigurationModelABC.__init__(self) self._admin_roles: list[int] = [] self._moderator_roles: list[int] = [] @property def admin_roles(self) -> list[int]: return self._admin_roles @property def moderator_roles(self) -> list[int]: return self._moderator_roles def from_dict(self, settings: dict): try: for id in settings['AdminRoleIds']: self._admin_roles.append(int(id)) for id in settings['ModeratorRoleIds']: self._moderator_roles.append(int(id)) except Exception as e: Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings') Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')