2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Merge pull request #154 from Furoin/mentioned

Add Message.mentioned and Filters.mentioned
This commit is contained in:
Dan 2018-11-06 17:38:53 +01:00 committed by GitHub
commit 1fe53c99f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -606,6 +606,7 @@ def parse_messages(
forward_from_message_id=forward_from_message_id, forward_from_message_id=forward_from_message_id,
forward_signature=forward_signature, forward_signature=forward_signature,
forward_date=forward_date, forward_date=forward_date,
mentioned=message.mentioned,
edit_date=message.edit_date, edit_date=message.edit_date,
media_group_id=message.grouped_id, media_group_id=message.grouped_id,
photo=photo, photo=photo,

View File

@ -168,6 +168,9 @@ class Filters:
dan = create("Dan", lambda _, m: bool(m.from_user and m.from_user.id == 23122162)) dan = create("Dan", lambda _, m: bool(m.from_user and m.from_user.id == 23122162))
mentioned = create("Mentioned", lambda _, m: bool(m.mentioned))
"""Filter messages containing mentions"""
@staticmethod @staticmethod
def command(command: str or list, def command(command: str or list,
prefix: str or list = "/", prefix: str or list = "/",

View File

@ -55,6 +55,9 @@ class Message(Object):
For replies, the original message. Note that the Message object in this field will not contain For replies, the original message. Note that the Message object in this field will not contain
further reply_to_message fields even if it itself is a reply. further reply_to_message fields even if it itself is a reply.
mentioned (``bool``, *optional*):
The message contains a mention.
edit_date (``int``, *optional*): edit_date (``int``, *optional*):
Date the message was last edited in Unix time. Date the message was last edited in Unix time.
@ -206,6 +209,7 @@ class Message(Object):
forward_signature: str = None, forward_signature: str = None,
forward_date: int = None, forward_date: int = None,
reply_to_message=None, reply_to_message=None,
mentioned=None,
edit_date: int = None, edit_date: int = None,
media_group_id: str = None, media_group_id: str = None,
author_signature: str = None, author_signature: str = None,
@ -253,6 +257,7 @@ class Message(Object):
self.forward_signature = forward_signature # flags.4?string self.forward_signature = forward_signature # flags.4?string
self.forward_date = forward_date # flags.5?int self.forward_date = forward_date # flags.5?int
self.reply_to_message = reply_to_message # flags.6?Message self.reply_to_message = reply_to_message # flags.6?Message
self.mentioned = mentioned
self.edit_date = edit_date # flags.7?int self.edit_date = edit_date # flags.7?int
self.media_group_id = media_group_id # flags.8?string self.media_group_id = media_group_id # flags.8?string
self.author_signature = author_signature # flags.9?string self.author_signature = author_signature # flags.9?string