0.4.3 - Befehl AFK #41

Merged
edraft merged 4 commits from 0.4.3 into 0.4 2022-01-07 14:56:52 +01:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit dc025170e1 - Show all commits

View File

@ -11,6 +11,7 @@
910199452915093594 910199452915093594
], ],
"PurgeMessage": "Ja mein Herr, ich lösche alle Nachrichten!", "PurgeMessage": "Ja mein Herr, ich lösche alle Nachrichten!",
"NoPermissionsMessage": "Nein!\nIch höre nicht auf dich ¯\\_(ツ)_/¯" "NoPermissionsMessage": "Nein!\nIch höre nicht auf dich ¯\\_(ツ)_/¯",
"AFKCommandChannelId": 910199452915093594
} }
} }

View File

@ -18,6 +18,7 @@ class BaseSettings(ConfigurationModelABC):
self._afk_channel_ids: list[int] = [] self._afk_channel_ids: list[int] = []
self._purge_message: str = '' self._purge_message: str = ''
self._no_permissions_message: str = '' self._no_permissions_message: str = ''
self._afk_command_channel_id: int = 0
@property @property
def welcome_message(self) -> str: def welcome_message(self) -> str:
@ -55,6 +56,10 @@ class BaseSettings(ConfigurationModelABC):
def no_permissions_message(self) -> str: def no_permissions_message(self) -> str:
return self._no_permissions_message return self._no_permissions_message
@property
def afk_command_channel_ids(self) -> int:
return self._afk_command_channel_id
def from_dict(self, settings: dict): def from_dict(self, settings: dict):
try: try:
self._welcome_message = settings['WelcomeMessage'] self._welcome_message = settings['WelcomeMessage']
@ -67,6 +72,7 @@ class BaseSettings(ConfigurationModelABC):
self._afk_channel_ids.append(int(id)) self._afk_channel_ids.append(int(id))
self._purge_message = settings['PurgeMessage'] self._purge_message = settings['PurgeMessage']
self._no_permissions_message = settings['NoPermissionsMessage'] self._no_permissions_message = settings['NoPermissionsMessage']
self._afk_command_channel_id = settings['AFKCommandChannelId']
except Exception as e: except Exception as e:
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings') Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}') Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')