From 5840f594efd1361cbda44f22aac096e2b869c7ca Mon Sep 17 00:00:00 2001 From: Alexei Date: Wed, 9 Aug 2023 13:36:42 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=20=D0=BF=D0=BE=D0=B4=D0=BF=D0=B8=D1=81=D0=BA=D0=B0=D0=BC?= =?UTF-8?q?=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot_modules/subscribes.py | 5 +++-- bot_sys/bot_subscribes.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bot_modules/subscribes.py b/bot_modules/subscribes.py index ae26e3f..84c2715 100644 --- a/bot_modules/subscribes.py +++ b/bot_modules/subscribes.py @@ -143,6 +143,7 @@ messages = { mod_table_operate.Messages.SUCCESS_DELETE: '''✅ Подписка успешно удалёна!''', } +# TODO Возможно это не нужно есть же mod_table_operate.EnumButton(bot_subscribes.SubscribeType.ADD) см. выше messages_subs_type_status = { mod_table_operate.EnumMessageForView(bot_subscribes.SubscribeType.ADD): f'''Добавление элемента''', mod_table_operate.EnumMessageForView(bot_subscribes.SubscribeType.ANY_ITEM_DEL): f'''Удаление элемента''', @@ -234,8 +235,8 @@ class ModuleUserSubscribe(ModuleSubscribe): 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) + k = mod_table_operate.EnumButton(t) + m = button_names.get(k, None) if m and m == a_Type: a_Type = t break diff --git a/bot_sys/bot_subscribes.py b/bot_sys/bot_subscribes.py index b37f258..db22367 100644 --- a/bot_sys/bot_subscribes.py +++ b/bot_sys/bot_subscribes.py @@ -30,8 +30,8 @@ class BotSubscribes: for user_id, su in s.items(): sub_um = su.get(a_ModuleName, None) if sub_um: - t = sub_um.get(str(a_ItemID), None) - if t == a_Type: + i = sub_um.get(str(a_Type), None) + if i == str(a_ItemID): 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][str(a_ItemID)] = a_Type + s[a_UserID][a_ModuleName][str(a_Type)] = str(a_ItemID) def Test(): a = set()