From 2c06017cc3d630d235669ed5be3f66db9ddcc8fd Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Tue, 13 Aug 2024 23:48:40 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D1=87=D0=B0=D1=82=D1=8B,=20=D0=B5=D1=81?= =?UTF-8?q?=D0=BB=D0=B8=20=D0=BE=D0=BD=D0=B8=20=D0=BD=D0=B5=20=D1=83=D0=BA?= =?UTF-8?q?=D0=B0=D0=B7=D0=B0=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ocab_modules/ocab_modules/standard/filters/filters.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ocab_modules/ocab_modules/standard/filters/filters.py b/src/ocab_modules/ocab_modules/standard/filters/filters.py index 3457048..4370baf 100644 --- a/src/ocab_modules/ocab_modules/standard/filters/filters.py +++ b/src/ocab_modules/ocab_modules/standard/filters/filters.py @@ -54,6 +54,11 @@ class ChatIDFilter(BaseFilter): chat_id = message.chat.id approved_chats = self.approved_chats or get_approved_chat_id() + + # Если список для фильтрации пуст - разрешаем всем. + if len(approved_chats) == 0: + return True + res = chat_id in approved_chats return res ^ (self.blacklist)