From f7416d4a21bd0ef792c3474af223e8465ff883ee Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 16 Dec 2023 12:37:56 +0800 Subject: [PATCH] :bug: Fix sudo filters do not filter self --- pagermaid/listener.py | 2 +- pagermaid/web/api/status.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pagermaid/listener.py b/pagermaid/listener.py index c153912..3b1de0b 100644 --- a/pagermaid/listener.py +++ b/pagermaid/listener.py @@ -91,7 +91,7 @@ def listener(**args): else: base_filters = filters.all permission_name = get_permission_name(is_plugin, need_admin, command) - sudo_filters = sudo_filter(permission_name) & ~filters.via_bot + sudo_filters = sudo_filter(permission_name) & ~filters.via_bot & ~filters.me if ignore_forwarded: base_filters &= ~filters.forwarded sudo_filters &= ~filters.forwarded diff --git a/pagermaid/web/api/status.py b/pagermaid/web/api/status.py index f2ed888..a43a18c 100644 --- a/pagermaid/web/api/status.py +++ b/pagermaid/web/api/status.py @@ -23,7 +23,7 @@ async def get_log(token: Optional[str] = Header(...), num: Union[int, str] = 100 num = 100 async def streaming_logs(): - with open("pagermaid.log.txt", "r", encoding="utf-8") as f: + with open("data/pagermaid.log.txt", "r", encoding="utf-8") as f: for log in f.readlines()[-num:]: yield log await asyncio.sleep(0.02)