mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Merge pull request #39 from yasirarism/main
Pyrofork: Add filters.react and add edit_hide to Message object
This commit is contained in:
commit
1bb0c85d31
2 changed files with 17 additions and 1 deletions
|
|
@ -234,6 +234,16 @@ reply = create(reply_filter)
|
||||||
"""Filter messages that are replies to other messages."""
|
"""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
|
# endregion
|
||||||
|
|
||||||
# region forwarded_filter
|
# region forwarded_filter
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,9 @@ class Message(Object, Update):
|
||||||
edit_date (:py:obj:`~datetime.datetime`, *optional*):
|
edit_date (:py:obj:`~datetime.datetime`, *optional*):
|
||||||
Date the message was last edited.
|
Date the message was last edited.
|
||||||
|
|
||||||
|
edit_hide (``bool``, *optional*):
|
||||||
|
True, if the message is edited by react.
|
||||||
|
|
||||||
media_group_id (``str``, *optional*):
|
media_group_id (``str``, *optional*):
|
||||||
The unique identifier of a media message group this message belongs to.
|
The unique identifier of a media message group this message belongs to.
|
||||||
|
|
||||||
|
|
@ -390,6 +393,7 @@ class Message(Object, Update):
|
||||||
service: "enums.MessageServiceType" = None,
|
service: "enums.MessageServiceType" = None,
|
||||||
scheduled: bool = None,
|
scheduled: bool = None,
|
||||||
from_scheduled: bool = None,
|
from_scheduled: bool = None,
|
||||||
|
edit_hide: bool = None,
|
||||||
media: "enums.MessageMediaType" = None,
|
media: "enums.MessageMediaType" = None,
|
||||||
edit_date: datetime = None,
|
edit_date: datetime = None,
|
||||||
media_group_id: str = None,
|
media_group_id: str = None,
|
||||||
|
|
@ -486,6 +490,7 @@ class Message(Object, Update):
|
||||||
self.from_scheduled = from_scheduled
|
self.from_scheduled = from_scheduled
|
||||||
self.media = media
|
self.media = media
|
||||||
self.edit_date = edit_date
|
self.edit_date = edit_date
|
||||||
|
self.edit_hide = edit_hide
|
||||||
self.media_group_id = media_group_id
|
self.media_group_id = media_group_id
|
||||||
self.author_signature = author_signature
|
self.author_signature = author_signature
|
||||||
self.has_protected_content = has_protected_content
|
self.has_protected_content = has_protected_content
|
||||||
|
|
@ -1001,6 +1006,7 @@ class Message(Object, Update):
|
||||||
scheduled=is_scheduled,
|
scheduled=is_scheduled,
|
||||||
from_scheduled=message.from_scheduled,
|
from_scheduled=message.from_scheduled,
|
||||||
media=media_type,
|
media=media_type,
|
||||||
|
edit_hide=message.edit_hide,
|
||||||
edit_date=utils.timestamp_to_datetime(message.edit_date),
|
edit_date=utils.timestamp_to_datetime(message.edit_date),
|
||||||
media_group_id=message.grouped_id,
|
media_group_id=message.grouped_id,
|
||||||
photo=photo,
|
photo=photo,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue