From b8311c034e23241fdb28ae139cd7d85caa69e5f6 Mon Sep 17 00:00:00 2001 From: 2noik <2noik@MacBookAir-8.local> Date: Tue, 28 Jan 2020 23:45:35 +0300 Subject: [PATCH] add send_phone_number_to_provider and send_email_to_provider --- aiogram/bot/bot.py | 7 +++++++ aiogram/dispatcher/webhook.py | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/aiogram/bot/bot.py b/aiogram/bot/bot.py index 30974f3a..39313558 100644 --- a/aiogram/bot/bot.py +++ b/aiogram/bot/bot.py @@ -210,6 +210,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin): :return: On success, the sent Message is returned :rtype: :obj:`types.Message` """ + reply_markup = prepare_arg(reply_markup) payload = generate_payload(**locals()) if self.parse_mode: @@ -1930,6 +1931,8 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin): need_phone_number: typing.Union[base.Boolean, None] = None, need_email: typing.Union[base.Boolean, None] = None, need_shipping_address: typing.Union[base.Boolean, None] = None, + send_phone_number_to_provider: typing.Union[base.Boolean, None] = None, + send_email_to_provider: typing.Union[base.Boolean, None] = None, is_flexible: typing.Union[base.Boolean, None] = None, disable_notification: typing.Union[base.Boolean, None] = None, reply_to_message_id: typing.Union[base.Integer, None] = None, @@ -1976,6 +1979,10 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin): :type need_email: :obj:`typing.Union[base.Boolean, None]` :param need_shipping_address: Pass True, if you require the user's shipping address to complete the order :type need_shipping_address: :obj:`typing.Union[base.Boolean, None]` + :param send_phone_number_to_provider: Pass True, if user's phone number should be sent to provider + :type send_phone_number_to_provider: :obj:`typing.Union[base.Boolean, None]` + :param send_email_to_provider: Pass True, if user's email address should be sent to provider + :type send_email_to_provider: :obj:`typing.Union[base.Boolean, None]` :param is_flexible: Pass True, if the final price depends on the shipping method :type is_flexible: :obj:`typing.Union[base.Boolean, None]` :param disable_notification: Sends the message silently. Users will receive a notification with no sound diff --git a/aiogram/dispatcher/webhook.py b/aiogram/dispatcher/webhook.py index 135fe21e..a717b486 100644 --- a/aiogram/dispatcher/webhook.py +++ b/aiogram/dispatcher/webhook.py @@ -1967,7 +1967,8 @@ class SendInvoice(BaseResponse, ReplyToMixin, DisableNotificationMixin): __slots__ = ('chat_id', 'title', 'description', 'payload', 'provider_token', 'start_parameter', 'currency', 'prices', 'photo_url', 'photo_size', 'photo_width', 'photo_height', - 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', 'is_flexible', + 'need_name', 'need_phone_number', 'need_email', 'need_shipping_address', + 'send_phone_number_to_provider', 'send_email_to_provider', 'is_flexible', 'disable_notification', 'reply_to_message_id', 'reply_markup') method = api.Methods.SEND_INVOICE @@ -1988,6 +1989,8 @@ class SendInvoice(BaseResponse, ReplyToMixin, DisableNotificationMixin): need_phone_number: Optional[Boolean] = None, need_email: Optional[Boolean] = None, need_shipping_address: Optional[Boolean] = None, + send_phone_number_to_provider: Optional[Boolean] = None, + send_email_to_provider: Optional[Boolean] = None, is_flexible: Optional[Boolean] = None, disable_notification: Optional[Boolean] = None, reply_to_message_id: Optional[Integer] = None, @@ -2016,6 +2019,10 @@ class SendInvoice(BaseResponse, ReplyToMixin, DisableNotificationMixin): :param need_email: Boolean (Optional) - Pass True, if you require the user's email to complete the order :param need_shipping_address: Boolean (Optional) - Pass True, if you require the user's shipping address to complete the order + :param send_phone_number_to_provider: Boolean (Optional) - Pass True, if user's phone number should be sent + to provider + :param send_email_to_provider: Boolean (Optional) - Pass True, if user's email address should be sent + to provider :param is_flexible: Boolean (Optional) - Pass True, if the final price depends on the shipping method :param disable_notification: Boolean (Optional) - Sends the message silently. Users will receive a notification with no sound. @@ -2039,6 +2046,8 @@ class SendInvoice(BaseResponse, ReplyToMixin, DisableNotificationMixin): self.need_phone_number = need_phone_number self.need_email = need_email self.need_shipping_address = need_shipping_address + self.send_phone_number_to_provider = send_phone_number_to_provider + self.send_email_to_provider = send_email_to_provider self.is_flexible = is_flexible self.disable_notification = disable_notification self.reply_to_message_id = reply_to_message_id @@ -2062,6 +2071,8 @@ class SendInvoice(BaseResponse, ReplyToMixin, DisableNotificationMixin): 'need_phone_number': self.need_phone_number, 'need_email': self.need_email, 'need_shipping_address': self.need_shipping_address, + 'send_phone_number_to_provider': self.send_phone_number_to_provider, + 'send_email_to_provider': self.send_email_to_provider, 'is_flexible': self.is_flexible, 'disable_notification': self.disable_notification, 'reply_to_message_id': self.reply_to_message_id,