Skip to content

Commit 7e46357

Browse files
committed
pyrofork: filters: topic: Add support for general topic
Signed-off-by: wulan17 <wulan17@nusantararom.org>
1 parent 07d4d61 commit 7e46357

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pyrogram/filters.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ class topic(Filter, set):
10811081
Parameters:
10821082
topics (``int`` | ``list``):
10831083
Pass one or more topic ids to filter messages in specific topics.
1084+
Pass 1 for general topic.
10841085
Defaults to None (no topics).
10851086
"""
10861087

@@ -1092,4 +1093,6 @@ def __init__(self, topics: Union[int, List[int]] = None):
10921093
)
10931094

10941095
async def __call__(self, _, message: Message):
1096+
if message.is_topic_message and not message.topic:
1097+
return 1 in self
10951098
return message.topic and message.topic.id in self

0 commit comments

Comments
 (0)