Added vCard support when sharing contacts

This commit is contained in:
Alex Root Junior 2018-07-29 02:17:17 +03:00
parent 0a847c4de7
commit f635b5c965
4 changed files with 6 additions and 0 deletions

View file

@ -706,6 +706,7 @@ class Bot(BaseBot):
async def send_contact(self, chat_id: typing.Union[base.Integer, base.String],
phone_number: base.String, first_name: base.String,
last_name: typing.Union[base.String, None] = None,
vcard: typing.Union[base.String, None] = None,
disable_notification: typing.Union[base.Boolean, None] = None,
reply_to_message_id: typing.Union[base.Integer, None] = None,
reply_markup: typing.Union[types.InlineKeyboardMarkup,
@ -725,6 +726,8 @@ class Bot(BaseBot):
:type first_name: :obj:`base.String`
:param last_name: Contact's last name
:type last_name: :obj:`typing.Union[base.String, None]`
:param vcard: vcard
:type vcard: :obj:`typing.Union[base.String, None]`
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
:type disable_notification: :obj:`typing.Union[base.Boolean, None]`
:param reply_to_message_id: If the message is a reply, ID of the original message

View file

@ -12,6 +12,7 @@ class Contact(base.TelegramObject):
first_name: base.String = fields.Field()
last_name: base.String = fields.Field()
user_id: base.Integer = fields.Field()
vcard: base.String = fields.Field()
@property
def full_name(self):

View file

@ -441,6 +441,7 @@ class InlineQueryResultContact(InlineQueryResult):
phone_number: base.String = fields.Field()
first_name: base.String = fields.Field()
last_name: base.String = fields.Field()
vcard: base.String = fields.Field()
input_message_content: InputMessageContent = fields.Field(base=InputMessageContent)
thumb_url: base.String = fields.Field()
thumb_width: base.Integer = fields.Field()

View file

@ -27,6 +27,7 @@ class InputContactMessageContent(InputMessageContent):
phone_number: base.String = fields.Field()
first_name: base.String = fields.Field()
last_name: base.String = fields.Field()
vcard: base.String = fields.Field()
def __init__(self, phone_number: base.String,
first_name: typing.Optional[base.String] = None,