Merge pull request #39 from yasirarism/main

Pyrofork: Add filters.react and add edit_hide to Message object
This commit is contained in:
2023-12-15 21:17:40 +07:00 committed by GitHub
commit 1bb0c85d31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -234,6 +234,16 @@ reply = create(reply_filter)
"""Filter messages that are replies to other messages."""
# endregion
# region reaction_filter
async def reaction_filter(_, __, m: Message):
return bool(m.edit_hide)
react = create(reaction_filter)
"""Filter reactions."""
# endregion
# region forwarded_filter

View file

@ -147,6 +147,9 @@ class Message(Object, Update):
edit_date (:py:obj:`~datetime.datetime`, *optional*):
Date the message was last edited.
edit_hide (``bool``, *optional*):
True, if the message is edited by react.
media_group_id (``str``, *optional*):
The unique identifier of a media message group this message belongs to.
@ -390,6 +393,7 @@ class Message(Object, Update):
service: "enums.MessageServiceType" = None,
scheduled: bool = None,
from_scheduled: bool = None,
edit_hide: bool = None,
media: "enums.MessageMediaType" = None,
edit_date: datetime = None,
media_group_id: str = None,
@ -486,6 +490,7 @@ class Message(Object, Update):
self.from_scheduled = from_scheduled
self.media = media
self.edit_date = edit_date
self.edit_hide = edit_hide
self.media_group_id = media_group_id
self.author_signature = author_signature
self.has_protected_content = has_protected_content
@ -1001,6 +1006,7 @@ class Message(Object, Update):
scheduled=is_scheduled,
from_scheduled=message.from_scheduled,
media=media_type,
edit_hide=message.edit_hide,
edit_date=utils.timestamp_to_datetime(message.edit_date),
media_group_id=message.grouped_id,
photo=photo,
@ -4503,4 +4509,4 @@ class Message(Object, Update):
)
reply_message.request = request
return reply_message
return reply_message