From 885a832aa328596501a294bf12060ceae5cb046d Mon Sep 17 00:00:00 2001 From: wulan17 Date: Wed, 22 Jan 2025 02:06:47 +0700 Subject: [PATCH] pyrofork: filters: topic: Add support for general topic Signed-off-by: wulan17 --- pyrogram/filters.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrogram/filters.py b/pyrogram/filters.py index da6f0127..a7b17a60 100644 --- a/pyrogram/filters.py +++ b/pyrogram/filters.py @@ -1081,6 +1081,7 @@ class topic(Filter, set): Parameters: topics (``int`` | ``list``): Pass one or more topic ids to filter messages in specific topics. + Pass 1 for general topic. Defaults to None (no topics). """ @@ -1092,4 +1093,6 @@ class topic(Filter, set): ) async def __call__(self, _, message: Message): + if message.is_topic_message and not message.topic: + return 1 in self return message.topic and message.topic.id in self