From f635b5c96555b2222b55412fe15f69d4b5182ebe Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 29 Jul 2018 02:17:17 +0300 Subject: [PATCH] Added vCard support when sharing contacts --- aiogram/bot/bot.py | 3 +++ aiogram/types/contact.py | 1 + aiogram/types/inline_query_result.py | 1 + aiogram/types/input_message_content.py | 1 + 4 files changed, 6 insertions(+) diff --git a/aiogram/bot/bot.py b/aiogram/bot/bot.py index 868b7aa0..f249c78e 100644 --- a/aiogram/bot/bot.py +++ b/aiogram/bot/bot.py @@ -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 diff --git a/aiogram/types/contact.py b/aiogram/types/contact.py index 842d6044..b70045b9 100644 --- a/aiogram/types/contact.py +++ b/aiogram/types/contact.py @@ -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): diff --git a/aiogram/types/inline_query_result.py b/aiogram/types/inline_query_result.py index 62936961..1c6c0007 100644 --- a/aiogram/types/inline_query_result.py +++ b/aiogram/types/inline_query_result.py @@ -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() diff --git a/aiogram/types/input_message_content.py b/aiogram/types/input_message_content.py index 88f8a74f..736a4454 100644 --- a/aiogram/types/input_message_content.py +++ b/aiogram/types/input_message_content.py @@ -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,