mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Make send_message return the correct Message type
This commit is contained in:
parent
e2224054d2
commit
deed74840a
@ -1154,7 +1154,7 @@ class Client:
|
|||||||
"""
|
"""
|
||||||
style = self.html if parse_mode.lower() == "html" else self.markdown
|
style = self.html if parse_mode.lower() == "html" else self.markdown
|
||||||
|
|
||||||
return self.send(
|
r = self.send(
|
||||||
functions.messages.SendMessage(
|
functions.messages.SendMessage(
|
||||||
peer=self.resolve_peer(chat_id),
|
peer=self.resolve_peer(chat_id),
|
||||||
no_webpage=disable_web_page_preview or None,
|
no_webpage=disable_web_page_preview or None,
|
||||||
@ -1166,6 +1166,21 @@ class Client:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if isinstance(r, types.UpdateShortSentMessage):
|
||||||
|
return pyrogram_types.Message(
|
||||||
|
message_id=r.id,
|
||||||
|
date=r.date,
|
||||||
|
outgoing=r.out,
|
||||||
|
entities=utils.parse_entities(r.entities, {}) or None
|
||||||
|
)
|
||||||
|
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
users = {i.id: i for i in r.users}
|
||||||
|
chats = {i.id: i for i in r.chats}
|
||||||
|
|
||||||
|
return utils.parse_message(self, i.message, users, chats)
|
||||||
|
|
||||||
def forward_messages(self,
|
def forward_messages(self,
|
||||||
chat_id: int or str,
|
chat_id: int or str,
|
||||||
from_chat_id: int or str,
|
from_chat_id: int or str,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user