diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index cd2c34bf..eba4e65e 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -360,6 +360,7 @@ def parse_messages( phone_number=media.phone_number, first_name=media.first_name, last_name=media.last_name or None, + vcard=media.vcard or None, user_id=media.user_id or None ) elif isinstance(media, types.MessageMediaVenue): diff --git a/pyrogram/client/methods/messages/send_contact.py b/pyrogram/client/methods/messages/send_contact.py index fc0abdd5..1a894e30 100644 --- a/pyrogram/client/methods/messages/send_contact.py +++ b/pyrogram/client/methods/messages/send_contact.py @@ -26,6 +26,7 @@ class SendContact(BaseClient): phone_number: str, first_name: str, last_name: str = "", + vcard: str = "", disable_notification: bool = None, reply_to_message_id: int = None, reply_markup=None): @@ -47,6 +48,9 @@ class SendContact(BaseClient): last_name (``str``, *optional*): Contact's last name. + vcard (``str``, *optional*): + Contact's vCard information. + disable_notification (``bool``, *optional*): Sends the message silently. Users will receive a notification with no sound. @@ -68,9 +72,10 @@ class SendContact(BaseClient): functions.messages.SendMedia( peer=self.resolve_peer(chat_id), media=types.InputMediaContact( - phone_number, - first_name, - last_name + phone_number=phone_number, + first_name=first_name, + last_name=last_name, + vcard=vcard ), message="", silent=disable_notification or None, diff --git a/pyrogram/client/types/media/contact.py b/pyrogram/client/types/media/contact.py index f625120c..a89b170c 100644 --- a/pyrogram/client/types/media/contact.py +++ b/pyrogram/client/types/media/contact.py @@ -38,8 +38,16 @@ class Contact(Object): ID = 0xb0700011 - def __init__(self, phone_number: str, first_name: str, last_name: str = None, user_id=None): - self.phone_number = phone_number # string - self.first_name = first_name # string - self.last_name = last_name # flags.0?string - self.user_id = user_id # flags.1?int + def __init__( + self, + phone_number: str, + first_name: str, + last_name: str = None, + vcard: str = None, + user_id: int = None + ): + self.phone_number = phone_number + self.first_name = first_name + self.last_name = last_name + self.vcard = vcard + self.user_id = user_id