mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Make send_contact return the new type
This commit is contained in:
parent
797e8ba4e9
commit
20bd4fb605
@ -2268,7 +2268,7 @@ class Client:
|
|||||||
chat_id: int or str,
|
chat_id: int or str,
|
||||||
phone_number: str,
|
phone_number: str,
|
||||||
first_name: str,
|
first_name: str,
|
||||||
last_name: str,
|
last_name: str = "",
|
||||||
disable_notification: bool = None,
|
disable_notification: bool = None,
|
||||||
reply_to_message_id: int = None):
|
reply_to_message_id: int = None):
|
||||||
"""Use this method to send phone contacts.
|
"""Use this method to send phone contacts.
|
||||||
@ -2297,12 +2297,12 @@ class Client:
|
|||||||
If the message is a reply, ID of the original message.
|
If the message is a reply, ID of the original message.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
On success, the sent Message is returned.
|
On success, the sent :obj:`Message <pyrogram.Message>` is returned.
|
||||||
|
|
||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`Error <pyrogram.Error>`
|
||||||
"""
|
"""
|
||||||
return self.send(
|
r = self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=self.resolve_peer(chat_id),
|
peer=self.resolve_peer(chat_id),
|
||||||
media=types.InputMediaContact(
|
media=types.InputMediaContact(
|
||||||
@ -2317,6 +2317,13 @@ class Client:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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 message_parser.parse_message(self, i.message, users, chats)
|
||||||
|
|
||||||
def send_chat_action(self,
|
def send_chat_action(self,
|
||||||
chat_id: int or str,
|
chat_id: int or str,
|
||||||
action: callable,
|
action: callable,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user