From f60e48ab0a9044f6ece7148d9af8348b6574131f Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 6 Dec 2017 21:05:25 +0100 Subject: [PATCH] Add send_contact method --- pyrogram/client/client.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 231bdddf..7c112d35 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -432,3 +432,24 @@ class Client: random_id=self.rnd_id() ) ) + + def send_contact(self, + chat_id: int or str, + phone_number: str, + first_name: str, + last_name: str, + disable_notification: bool = None, + reply_to_message_id: int = None): + return self.send( + functions.messages.SendMedia( + peer=self.resolve_peer(chat_id), + media=types.InputMediaContact( + phone_number, + first_name, + last_name + ), + silent=disable_notification or None, + reply_to_msg_id=reply_to_message_id, + random_id=self.rnd_id() + ) + )