mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
New "outgoing" field to easily tell in/out messages apart
This commit is contained in:
parent
7c2c878333
commit
3e4135c8e1
@ -475,7 +475,8 @@ def parse_message(
|
|||||||
sticker=sticker,
|
sticker=sticker,
|
||||||
document=document,
|
document=document,
|
||||||
views=message.views,
|
views=message.views,
|
||||||
via_bot=parse_user(users.get(message.via_bot_id, None))
|
via_bot=parse_user(users.get(message.via_bot_id, None)),
|
||||||
|
outgoing=message.out
|
||||||
)
|
)
|
||||||
|
|
||||||
if message.reply_to_msg_id and replies:
|
if message.reply_to_msg_id and replies:
|
||||||
|
@ -177,6 +177,12 @@ class Message(Object):
|
|||||||
via_bot (:obj:`User <pyrogram.User>`):
|
via_bot (:obj:`User <pyrogram.User>`):
|
||||||
Via bot.
|
Via bot.
|
||||||
|
|
||||||
|
outgoing (``bool``):
|
||||||
|
Whether the message is incoming or outgoing.
|
||||||
|
Messages received from other chats are incoming (*outgoing* is False).
|
||||||
|
Messages sent from yourself to other chats are outgoing (*outgoing* is True).
|
||||||
|
An exception is made for your own personal chat; messages sent there will be incoming.
|
||||||
|
|
||||||
matches (``list``):
|
matches (``list``):
|
||||||
A list containing all `Match Objects <https://docs.python.org/3/library/re.html#match-objects>`_ that match
|
A list containing all `Match Objects <https://docs.python.org/3/library/re.html#match-objects>`_ that match
|
||||||
the text of this message. Only applicable when using :obj:`Filters.regex <pyrogram.Filters.regex>`.
|
the text of this message. Only applicable when using :obj:`Filters.regex <pyrogram.Filters.regex>`.
|
||||||
@ -233,6 +239,7 @@ class Message(Object):
|
|||||||
connected_website=None,
|
connected_website=None,
|
||||||
views: int = None,
|
views: int = None,
|
||||||
via_bot=None,
|
via_bot=None,
|
||||||
|
outgoing: bool = None,
|
||||||
matches: list = None,
|
matches: list = None,
|
||||||
command: list = None
|
command: list = None
|
||||||
):
|
):
|
||||||
@ -280,5 +287,6 @@ class Message(Object):
|
|||||||
self.connected_website = connected_website # flags.38?string
|
self.connected_website = connected_website # flags.38?string
|
||||||
self.views = views # flags.39?int
|
self.views = views # flags.39?int
|
||||||
self.via_bot = via_bot # flags.40?User
|
self.via_bot = via_bot # flags.40?User
|
||||||
|
self.outgoing = outgoing
|
||||||
self.matches = matches
|
self.matches = matches
|
||||||
self.command = command
|
self.command = command
|
||||||
|
Loading…
x
Reference in New Issue
Block a user