mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: filters: topic: Add support for general topic
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
a653065774
commit
885a832aa3
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue