Added settings
This commit is contained in:
parent
c9a5a64c7b
commit
dc025170e1
@ -11,6 +11,7 @@
|
||||
910199452915093594
|
||||
],
|
||||
"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
|
||||
}
|
||||
}
|
@ -18,6 +18,7 @@ class BaseSettings(ConfigurationModelABC):
|
||||
self._afk_channel_ids: list[int] = []
|
||||
self._purge_message: str = ''
|
||||
self._no_permissions_message: str = ''
|
||||
self._afk_command_channel_id: int = 0
|
||||
|
||||
@property
|
||||
def welcome_message(self) -> str:
|
||||
@ -55,6 +56,10 @@ class BaseSettings(ConfigurationModelABC):
|
||||
def no_permissions_message(self) -> str:
|
||||
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):
|
||||
try:
|
||||
self._welcome_message = settings['WelcomeMessage']
|
||||
@ -67,6 +72,7 @@ class BaseSettings(ConfigurationModelABC):
|
||||
self._afk_channel_ids.append(int(id))
|
||||
self._purge_message = settings['PurgeMessage']
|
||||
self._no_permissions_message = settings['NoPermissionsMessage']
|
||||
self._afk_command_channel_id = settings['AFKCommandChannelId']
|
||||
except Exception as e:
|
||||
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
||||
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|
||||
|
Reference in New Issue
Block a user