Added deploy command

This commit is contained in:
2022-07-19 16:26:33 +02:00
parent 4b08c99817
commit b753601979
10 changed files with 106 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ class BotSettings(ConfigurationModelABC):
self._servers: List[ServerSettings] = List()
self._technicians: list[int] = []
self._deploy_file_path = './'
@property
def servers(self) -> List[ServerSettings]:
@@ -23,10 +24,16 @@ class BotSettings(ConfigurationModelABC):
def technicians(self) -> list[int]:
return self._technicians
@property
def deploy_file_path(self) -> str:
return self._deploy_file_path
def from_dict(self, settings: dict):
try:
self._technicians = settings["Technicians"]
self._deploy_file_path = settings["DeployFilesPath"]
settings.pop("Technicians")
settings.pop("DeployFilesPath")
servers = List(ServerSettings)
for s in settings:
st = ServerSettings()

View File

@@ -96,7 +96,7 @@ class MessageService(MessageServiceABC):
self._logger.error(__name__, f'Send message to channel {ctx.channel.id} failed', e)
else:
self._logger.info(__name__, f'Sent message to channel {ctx.channel.id}')
if not without_tracking:
if not without_tracking and ctx.guild is not None:
self._clients.append_sent_message_count(self._bot.user.id, ctx.guild.id, 1)
self._db.save_changes()