diff --git a/bot_modules/access.py b/bot_modules/access.py index cebb89b..c5b9b6b 100644 --- a/bot_modules/access.py +++ b/bot_modules/access.py @@ -105,8 +105,8 @@ messages = { init_access = f'{user_access.user_access_group_new}=-' class ModuleAccess(mod_table_operate.TableOperateModule): - def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, None, None, init_access, a_ChildModuleNameList, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, None, None, init_access, a_ChildModuleNameList, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) self.m_SqlRequestButtonName = self.CreateButton('sql request', sql_request_button_name) self.m_RequestStartMessage = self.CreateMessage('equest start', request_start_message) diff --git a/bot_modules/all_orders.py b/bot_modules/all_orders.py index 2c1b30b..5efd31f 100644 --- a/bot_modules/all_orders.py +++ b/bot_modules/all_orders.py @@ -110,8 +110,8 @@ class DBItemForUserSelectSource(bd_item_select.DBItemSelectSource): return True class ModuleAllOrders(orders.ModuleOrders): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetInitBDCommands(self): # уже сделано в ModuleUserOrders diff --git a/bot_modules/backup.py b/bot_modules/backup.py index bd4ca67..cf294a2 100644 --- a/bot_modules/backup.py +++ b/bot_modules/backup.py @@ -47,8 +47,8 @@ messages = { init_access = f'{user_access.user_access_group_new}=-' class ModuleBackup(mod_simple_message.SimpleMessageModule): - def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) self.m_BackupBDButtonName = self.CreateButton('backup bd', backup_bd_button_name) self.m_BackupBDMessage = self.CreateMessage('backup bd', backup_bd_message) diff --git a/bot_modules/buttons.py b/bot_modules/buttons.py index a268b93..63e77fa 100644 --- a/bot_modules/buttons.py +++ b/bot_modules/buttons.py @@ -127,8 +127,8 @@ messages = { } class ModuleButtons(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/comments.py b/bot_modules/comments.py index 28eb8c7..953169f 100644 --- a/bot_modules/comments.py +++ b/bot_modules/comments.py @@ -3,7 +3,7 @@ # Комментарии -from bot_sys import bot_bd, keyboard, user_access, bd_table +from bot_sys import bot_bd, keyboard, user_access, bd_table, bot_subscribes from bot_modules import mod_table_operate, mod_simple_message # --------------------------------------------------------- @@ -118,9 +118,19 @@ messages = { mod_table_operate.Messages.SUCCESS_DELETE: '''✅ Комментарий успешно удалён!''', } +messages_subscribes = { + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ADD):f'''Комментарий создан''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_EDIT):f'''Комментарий отредактирован''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_DEL):f'''Комментарий удалён''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_EDIT):f'''Комментарий отредактирован #item_id''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_DEL):f'''Комментарий удалён #item_id''', +} + +messages.update(messages_subscribes) + class ModuleComments(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/groups.py b/bot_modules/groups.py index 7724eeb..c82485c 100644 --- a/bot_modules/groups.py +++ b/bot_modules/groups.py @@ -124,8 +124,8 @@ messages = { } class ModuleGroups(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/languages.py b/bot_modules/languages.py index 66af1b9..06d0835 100644 --- a/bot_modules/languages.py +++ b/bot_modules/languages.py @@ -125,8 +125,8 @@ messages = { } class ModuleLanguages(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) self.m_LanguageIDs = {} def GetName(self): diff --git a/bot_modules/messages.py b/bot_modules/messages.py index 2506c2a..310b043 100644 --- a/bot_modules/messages.py +++ b/bot_modules/messages.py @@ -127,8 +127,8 @@ messages = { } class ModuleMessages(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/mod_simple_message.py b/bot_modules/mod_simple_message.py index 0fc9128..0221977 100644 --- a/bot_modules/mod_simple_message.py +++ b/bot_modules/mod_simple_message.py @@ -17,13 +17,14 @@ class Messages(Enum): START = auto() class SimpleMessageModule(mod_interface.IModule): - def __init__(self, a_Messages, a_Buttons, a_InitAccess, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): + def __init__(self, a_Messages, a_Buttons, a_InitAccess, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): self.m_ChildModuleNameList = a_ChildModuleNameList self.m_InitAccess = a_InitAccess self.m_Bot = a_Bot self.m_ModuleAgregator = a_ModuleAgregator self.m_BotMessages = a_BotMessages self.m_BotButtons = a_BotButtons + self.m_BotSubscribes = a_BotSubscribes self.m_Log = a_Log self.m_Buttons = {} diff --git a/bot_modules/mod_table_operate.py b/bot_modules/mod_table_operate.py index 68a2950..acff162 100644 --- a/bot_modules/mod_table_operate.py +++ b/bot_modules/mod_table_operate.py @@ -3,7 +3,7 @@ # Модуль для редактирования и просмотра таблицы в БД -from bot_sys import keyboard, user_access, bd_table, bot_bd +from bot_sys import keyboard, user_access, bd_table, bot_bd, bot_subscribes from bot_modules import access_utils, mod_simple_message from template import simple_message, bd_item, bd_item_select, bd_item_view, bd_item_delete, bd_item_add, bd_item_edit @@ -31,6 +31,9 @@ def EnumMessageForView(a_EnumItem): def NotificationMessage(a_EnumItem): return 'notification ' + str(a_EnumItem) +def SubscribeMessage(a_EnumItem): + return 'subscribe ' + str(a_EnumItem) + class ButtonNames(Enum): LIST = auto() ADD = auto() @@ -80,8 +83,8 @@ def MakeFSMForEdit(a_ModName, a_FieldName): return _locals['fsm'] class TableOperateModule(mod_simple_message.SimpleMessageModule): - def __init__(self, a_Table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(a_Messages, a_Buttons, a_InitAccess, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_Table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(a_Messages, a_Buttons, a_InitAccess, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) self.m_Table = a_Table self.m_EditModuleNameList = a_EditModuleNameList self.m_ChildModName = a_ChildModName @@ -206,9 +209,19 @@ class TableOperateModule(mod_simple_message.SimpleMessageModule): return simple_message.WorkFuncResult(self.GetMessage(Messages.SUCCESS_DELETE), None, item_access = access) async def PostDelete(self, a_CallbackQuery, a_ItemID): - self.m_Log.Success(f'Задача №{a_ItemID} была удалена пользователем {a_CallbackQuery.from_user.id}.') + user_id = a_CallbackQuery.from_user.id + self.m_Log.Success(f'Задача №{a_ItemID} была удалена пользователем {user_id}.') #TODO: удалить вложенные self.OnChange() + + subscribe_type = bot_subscribes.SubscribeType.ANY_ITEM_DEL + item_id = -1 + await self.SendSubscribe(subscribe_type, item_id, user_id) + + subscribe_type = bot_subscribes.SubscribeType.ITEM_DEL + item_id = a_ItemID + await self.SendSubscribe(subscribe_type, item_id, user_id) + return simple_message.WorkFuncResult(self.GetMessage(Messages.SUCCESS_DELETE)) async def AddBDItemFunc(self, a_ItemData, a_UserID): @@ -252,8 +265,29 @@ class TableOperateModule(mod_simple_message.SimpleMessageModule): else: self.m_Log.Success(f'Пользователь {a_UserID}. Добавлена запись в таблицу {request} {param}.') + subscribe_type = bot_subscribes.SubscribeType.ADD + item_id = -1 + await self.SendSubscribe(subscribe_type, item_id, a_UserID) + return res, error + async def SendSubscribe(self, a_Type, a_ItemID, a_OwnerUserID): + for s_user_id in self.m_BotSubscribes.GetUserIDs(self.GetName(), a_Type, a_ItemID = a_ItemID): + a_BotMessage = self.GetMessage(SubscribeMessage(a_Type)) + if not a_BotMessage: + continue + if s_user_id == a_OwnerUserID: + continue + a_BotMessage = a_BotMessage.StaticCopy() + a_BotMessage.UpdateDesc(a_BotMessage.GetDesc().replace("#item_id", str(a_ItemID))) + a_GetButtonsFunc = None + a_GetInlineButtonsFunc = None + a_UserID = s_user_id + a_Message = None + user_groups = None + parse_mode = None + await simple_message.SendMessage(self.m_Bot, a_BotMessage, a_GetButtonsFunc, a_GetInlineButtonsFunc, a_UserID, a_Message, user_groups, parse_mode=parse_mode) + def SelectSourceTemplate(self, a_PrevPrefix, a_ButtonName): parent_id_field = self.m_Table.GetFieldNameByDestiny(bd_table.TableFieldDestiny.PARENT_ID) return bd_item_select.DBItemSelectSource(self.m_Bot, self.m_Table.GetName(), parent_id_field, a_PrevPrefix, a_ButtonName) @@ -296,7 +330,14 @@ class TableOperateModule(mod_simple_message.SimpleMessageModule): return None async def OnChangeField(self, a_Field, a_ItemID, a_ItemData, a_EditUserID): - pass + subscribe_type = bot_subscribes.SubscribeType.ANY_ITEM_EDIT + item_id = -1 + await self.SendSubscribe(subscribe_type, item_id, a_EditUserID) + + subscribe_type = bot_subscribes.SubscribeType.ITEM_EDIT + item_id = a_ItemID + await self.SendSubscribe(subscribe_type, item_id, a_EditUserID) + def RegisterEdit(self, a_Field, a_AccessMode = user_access.AccessMode.EDIT): a_ButtonName = self.GetButton(EditButton(a_Field.m_Destiny)) diff --git a/bot_modules/needs.py b/bot_modules/needs.py index 449f413..0f0bf2f 100644 --- a/bot_modules/needs.py +++ b/bot_modules/needs.py @@ -3,7 +3,7 @@ # Потребности -from bot_sys import bot_bd, keyboard, user_access, bd_table +from bot_sys import bot_bd, keyboard, user_access, bd_table, bot_subscribes from bot_modules import mod_table_operate, mod_simple_message # --------------------------------------------------------- @@ -119,9 +119,19 @@ messages = { mod_table_operate.Messages.SUCCESS_DELETE: '''✅ Потребность успешно удалёна!''', } +messages_subscribes = { + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ADD):f'''Потребность создана''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_EDIT):f'''Потребность отредактирована''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_DEL):f'''Потребность удалёна''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_EDIT):f'''Потребность отредактирована #item_id''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_DEL):f'''Потребность удалёна #item_id''', +} + +messages.update(messages_subscribes) + class ModuleNeeds(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/orders.py b/bot_modules/orders.py index e534a34..3559006 100644 --- a/bot_modules/orders.py +++ b/bot_modules/orders.py @@ -3,7 +3,7 @@ # Заказы -from bot_sys import bot_bd, keyboard, user_access, bd_table +from bot_sys import bot_bd, keyboard, user_access, bd_table, bot_subscribes from bot_modules import mod_table_operate, mod_simple_message from template import bd_item_select, bd_item_view, bd_item @@ -163,6 +163,16 @@ messages_order_status = { messages.update(messages_order_status) +messages_subscribes = { + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ADD):f'''Заказ создан''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_EDIT):f'''Заказ отредактирован''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_DEL):f'''Заказ удалён''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_EDIT):f'''Заказ отредактирован #item_id''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_DEL):f'''Заказ удалён #item_id''', +} + +messages.update(messages_subscribes) + def GetCurItemsTemplate(a_Bot, a_TableName, a_UserIDFieldName, a_StatusFieldName): def GetBDItems(a_Message, a_UserGroups, a_ParentID): user_id = str(a_Message.from_user.id) @@ -190,8 +200,8 @@ class DBItemForUserSelectSource(bd_item_select.DBItemSelectSource): return True class ModuleOrders(mod_table_operate.TableOperateModule): - def __init__(self, a_Table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_Table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def SelectSourceTemplate(self, a_PrevPrefix, a_ButtonName): parent_id_field = self.m_Table.GetFieldNameByDestiny(bd_table.TableFieldDestiny.PARENT_ID) @@ -251,8 +261,8 @@ class ModuleOrders(mod_table_operate.TableOperateModule): ) class ModuleUserOrders(ModuleOrders): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/profile.py b/bot_modules/profile.py index 8f3aba9..f0c2a67 100644 --- a/bot_modules/profile.py +++ b/bot_modules/profile.py @@ -31,8 +31,8 @@ messages = { init_access = f'{user_access.user_access_group_new}=+' class ModuleProfile(mod_simple_message.SimpleMessageModule): - def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/projects.py b/bot_modules/projects.py index 8a601ee..becbc93 100644 --- a/bot_modules/projects.py +++ b/bot_modules/projects.py @@ -3,7 +3,7 @@ # Проекты -from bot_sys import bot_bd, keyboard, user_access, bd_table +from bot_sys import bot_bd, keyboard, user_access, bd_table, bot_subscribes from bot_modules import mod_table_operate, mod_simple_message # --------------------------------------------------------- @@ -117,9 +117,19 @@ messages = { mod_table_operate.Messages.SUCCESS_DELETE: '''✅ Проект успешно удалён!''', } +messages_subscribes = { + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ADD):f'''Проект создан''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_EDIT):f'''Проект отредактирован''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_DEL):f'''Проект удалён''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_EDIT):f'''Проект отредактирован #item_id''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_DEL):f'''Проект удалён #item_id''', +} + +messages.update(messages_subscribes) + class ModuleProjects(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/start.py b/bot_modules/start.py index 8088ac7..dc55776 100644 --- a/bot_modules/start.py +++ b/bot_modules/start.py @@ -23,8 +23,8 @@ messages = { init_access = f'{user_access.user_access_group_all}=+' class ModuleStart(mod_simple_message.SimpleMessageModule): - def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/subscribes.py b/bot_modules/subscribes.py index 87a72fb..07722df 100644 --- a/bot_modules/subscribes.py +++ b/bot_modules/subscribes.py @@ -177,8 +177,8 @@ class DBItemForUserSelectSource(bd_item_select.DBItemSelectSource): return True class ModuleSubscribe(mod_table_operate.TableOperateModule): - def __init__(self, a_Table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_Table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, a_Messages, a_Buttons, a_ParentModName, a_ChildModName, a_InitAccess, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def SelectSourceTemplate(self, a_PrevPrefix, a_ButtonName): parent_id_field = self.m_Table.GetFieldNameByDestiny(bd_table.TableFieldDestiny.PARENT_ID) @@ -210,8 +210,37 @@ class ModuleSubscribe(mod_table_operate.TableOperateModule): return n + ":" + str(a_Item[type_field_id]) + ":" + str(a_Item[item_id_field_id]), k, a class ModuleUserSubscribe(ModuleSubscribe): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) + self.UpdateSubscribes() def GetName(self): return module_name + + def UpdateSubscribes(self): + self.m_BotSubscribes.Clear() + + mod_name_id_field = self.m_Table.GetFieldIDByDestiny(bd_table.TableFieldDestiny.NAME) + subscribe_type_id_field = self.m_Table.GetFieldIDByDestiny(bd_table.TableFieldDestiny.SUBSCRIBE_TYPE) + item_id_id_field = self.m_Table.GetFieldIDByDestiny(bd_table.TableFieldDestiny.ITEM_ID) + user_id_id_field = self.m_Table.GetFieldIDByDestiny(bd_table.TableFieldDestiny.PARENT_ID) + + table_name = self.m_Table.GetName() + s_bd = bd_item.GetAllItemsTemplate(self.m_Bot, table_name)() + if s_bd: + for s in s_bd: + a_ModuleName = s[mod_name_id_field] + a_Type = s[subscribe_type_id_field] + a_ItemID = s[item_id_id_field] + a_UserID = s[user_id_id_field] + for t in bot_subscribes.SubscribeType: + k = mod_table_operate.EnumMessageForView(t) + m = messages_subs_type_status.get(k, None) + if m and m == a_Type: + a_Type = t + break + + self.m_BotSubscribes.AddSubscribe(a_UserID, a_ModuleName, a_Type, a_ItemID) + + def OnChange(self): + self.UpdateSubscribes() diff --git a/bot_modules/tasks.py b/bot_modules/tasks.py index 4234622..8e148b7 100644 --- a/bot_modules/tasks.py +++ b/bot_modules/tasks.py @@ -3,7 +3,7 @@ # Задачи -from bot_sys import bot_bd, keyboard, user_access, bd_table +from bot_sys import bot_bd, keyboard, user_access, bd_table, bot_subscribes from bot_modules import mod_table_operate, mod_simple_message # --------------------------------------------------------- @@ -119,9 +119,19 @@ messages = { mod_table_operate.Messages.SUCCESS_DELETE: '''✅ Задача успешно удалёна!''', } +messages_subscribes = { + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ADD):f'''Задача создана''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_EDIT):f'''Задача отредактирована''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ANY_ITEM_DEL):f'''Задача удалёна''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_EDIT):f'''Задача отредактирована #item_id''', + mod_table_operate.SubscribeMessage(bot_subscribes.SubscribeType.ITEM_DEL):f'''Задача удалёна #item_id''', +} + +messages.update(messages_subscribes) + class ModuleTasks(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/user_in_groups.py b/bot_modules/user_in_groups.py index a7bacda..f2e7830 100644 --- a/bot_modules/user_in_groups.py +++ b/bot_modules/user_in_groups.py @@ -105,8 +105,8 @@ messages = { } class ModuleUserInGroups(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/users.py b/bot_modules/users.py index f56386c..e4feaee 100644 --- a/bot_modules/users.py +++ b/bot_modules/users.py @@ -127,8 +127,8 @@ messages = { } class ModuleUsers(mod_table_operate.TableOperateModule): - def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ParentModName, a_ChildModName, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(table, messages, button_names, a_ParentModName, a_ChildModName, init_access, a_ChildModuleNameList, a_EditModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) def GetName(self): return module_name diff --git a/bot_modules/users_groups_agregator.py b/bot_modules/users_groups_agregator.py index 0f4f3bc..4c4533a 100644 --- a/bot_modules/users_groups_agregator.py +++ b/bot_modules/users_groups_agregator.py @@ -56,8 +56,8 @@ messages = { init_access = f'{user_access.user_access_group_new}=-' class ModuleUsersGroupsAgregator(mod_simple_message.SimpleMessageModule): - def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log): - super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_Log) + def __init__(self, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log): + super().__init__(messages, button_names, init_access, a_ChildModuleNameList, a_Bot, a_ModuleAgregator, a_BotMessages, a_BotButtons, a_BotSubscribes, a_Log) self.m_SqlRequestButtonName = self.CreateButton('sql request', sql_request_button_name) self.m_RequestStartMessage = self.CreateMessage('equest start', request_start_message) diff --git a/bot_sys/bot_subscribes.py b/bot_sys/bot_subscribes.py index 3fe19c5..b37f258 100644 --- a/bot_sys/bot_subscribes.py +++ b/bot_sys/bot_subscribes.py @@ -30,7 +30,7 @@ class BotSubscribes: for user_id, su in s.items(): sub_um = su.get(a_ModuleName, None) if sub_um: - t = sub_um.get(a_ItemID, None) + t = sub_um.get(str(a_ItemID), None) if t == a_Type: ids.add(user_id) return ids @@ -41,7 +41,7 @@ class BotSubscribes: s[a_UserID] = {} if not s[a_UserID].get(a_ModuleName, None): s[a_UserID][a_ModuleName] = {} - s[a_UserID][a_ModuleName][a_ItemID] = a_Type + s[a_UserID][a_ModuleName][str(a_ItemID)] = a_Type def Test(): a = set() diff --git a/main.py b/main.py index cdab68d..9675156 100644 --- a/main.py +++ b/main.py @@ -24,6 +24,7 @@ g_Bot = aiogram_bot.AiogramBot(config.GetTelegramBotApiToken(), bd_file_name, co g_BotMessages = bot_messages.BotMessages(default_language) g_BotButtons = bot_messages.BotMessages(default_language) +g_BotSubscribes = bot_subscribes.BotSubscribes() g_ModuleAgregator = mod_agregator.ModuleAgregator() @@ -42,67 +43,67 @@ mod_orders_name = orders.module_name mod_all_orders_name = all_orders.module_name start_mod_list = [mod_start_name] -mod_access = access.ModuleAccess(start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_access = access.ModuleAccess(start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_access) -mod_users = users.ModuleUsers(None, None, start_mod_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_users = users.ModuleUsers(None, None, start_mod_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_users) child_mod_name_list = [mod_start_name, mod_users_name, mod_user_in_groups_name] -mod_groups = groups.ModuleGroups(None, mod_user_in_groups_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_groups = groups.ModuleGroups(None, mod_user_in_groups_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_groups) -mod_user_in_groups = user_in_groups.ModuleUserInGroups(mod_groups_name, None, start_mod_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_user_in_groups = user_in_groups.ModuleUserInGroups(mod_groups_name, None, start_mod_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_user_in_groups) child_mod_name_list = [mod_start_name, mod_users_name, mod_groups_name, mod_user_in_groups_name] -mod_users_groups_agregator = users_groups_agregator.ModuleUsersGroupsAgregator(child_mod_name_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_users_groups_agregator = users_groups_agregator.ModuleUsersGroupsAgregator(child_mod_name_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_users_groups_agregator) -mod_profile = profile.ModuleProfile(start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_profile = profile.ModuleProfile(start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_profile) -mod_backup = backup.ModuleBackup(start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_backup = backup.ModuleBackup(start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_backup) child_mod_name_list = [mod_start_name, mod_tasks_name, mod_needs_name, mod_comments_name] -mod_project = projects.ModuleProjects(None, mod_tasks_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_project = projects.ModuleProjects(None, mod_tasks_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_project) child_mod_name_list = [mod_start_name]#, mod_projects_name, mod_needs_name, mod_comments_name] -mod_tasks = tasks.ModuleTasks(mod_projects_name, mod_needs_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_tasks = tasks.ModuleTasks(mod_projects_name, mod_needs_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_tasks) child_mod_name_list = [mod_start_name]#, mod_projects_name, mod_tasks_name, mod_comments_name] -mod_needs= needs.ModuleNeeds(mod_tasks_name, mod_comments_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_needs= needs.ModuleNeeds(mod_tasks_name, mod_comments_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_needs) child_mod_name_list = [mod_start_name]#, mod_projects_name, mod_tasks_name, mod_needs_name] -mod_comments= comments.ModuleComments(mod_needs_name, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_comments= comments.ModuleComments(mod_needs_name, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_comments) child_mod_name_list = [mod_start_name, mod_messages_name, mod_buttons_name] -mod_languages = languages.ModuleLanguages(None, mod_messages_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_languages = languages.ModuleLanguages(None, mod_messages_name, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_languages) child_mod_name_list = [mod_start_name] -mod_messages = messages.ModuleMessages(mod_languages_name, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_messages = messages.ModuleMessages(mod_languages_name, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_messages) child_mod_name_list = [mod_start_name] -mod_buttons = buttons.ModuleButtons(mod_languages_name, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_buttons = buttons.ModuleButtons(mod_languages_name, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_buttons) child_mod_name_list = [mod_start_name] -mod_orders = orders.ModuleUserOrders(None, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_orders = orders.ModuleUserOrders(None, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_orders) child_mod_name_list = [mod_start_name] -mod_all_orders = all_orders.ModuleAllOrders(None, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_all_orders = all_orders.ModuleAllOrders(None, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_all_orders) child_mod_name_list = [mod_start_name] -mod_subscribe = subscribes.ModuleUserSubscribe(None, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_subscribe = subscribes.ModuleUserSubscribe(None, None, child_mod_name_list, start_mod_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_subscribe) child_mod_name_list = [ @@ -116,7 +117,7 @@ child_mod_name_list = [ mod_all_orders.GetName(), mod_subscribe.GetName(), ] -mod_start = start.ModuleStart(child_mod_name_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_Log) +mod_start = start.ModuleStart(child_mod_name_list, g_Bot, g_ModuleAgregator, g_BotMessages, g_BotButtons, g_BotSubscribes, g_Log) g_ModuleAgregator.AddModule(mod_start) # Первичная инициализация модулей.