From 1f4a863f71bcb39bd85f822c7af962a90658301b Mon Sep 17 00:00:00 2001 From: Oleg A Date: Sun, 8 Nov 2020 13:59:44 +0300 Subject: [PATCH] AIOG-T-93 added allow_sending_without_reply to send_document shortcuts --- aiogram/types/message.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/aiogram/types/message.py b/aiogram/types/message.py index df64d119..bf30c52a 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -580,6 +580,7 @@ class Message(base.TelegramObject): parse_mode: typing.Optional[base.String] = None, disable_content_type_detection: typing.Optional[base.Boolean] = None, disable_notification: typing.Optional[base.Boolean] = None, + allow_sending_without_reply: typing.Optional[base.Boolean] = None, reply_markup: typing.Union[ InlineKeyboardMarkup, ReplyKeyboardMarkup, @@ -618,8 +619,9 @@ class Message(base.TelegramObject): notification with no sound :type disable_notification: :obj:`typing.Optional[base.Boolean]` - :param reply: True if the message is a reply - :type reply: :obj:`typing.Optional[base.Boolean]` + :param allow_sending_without_reply: Pass True, if the message should be sent + even if the specified replied-to message is not found + :type allow_sending_without_reply: :obj:`typing.Optional[base.Boolean]` :param reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove @@ -628,6 +630,9 @@ class Message(base.TelegramObject): types.ReplyKeyboardMarkup, types.ReplyKeyboardRemove, types.ForceReply], None]` + :param reply: True if the message is a reply + :type reply: :obj:`typing.Optional[base.Boolean]` + :return: On success, the sent Message is returned :rtype: :obj:`types.Message` """ @@ -640,6 +645,7 @@ class Message(base.TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, reply_to_message_id=self.message_id if reply else None, + allow_sending_without_reply=allow_sending_without_reply, reply_markup=reply_markup, ) @@ -1467,6 +1473,7 @@ class Message(base.TelegramObject): parse_mode: typing.Optional[base.String] = None, disable_content_type_detection: typing.Optional[base.Boolean] = None, disable_notification: typing.Optional[base.Boolean] = None, + allow_sending_without_reply: typing.Optional[base.Boolean] = None, reply_markup: typing.Union[ InlineKeyboardMarkup, ReplyKeyboardMarkup, @@ -1505,8 +1512,9 @@ class Message(base.TelegramObject): notification with no sound :type disable_notification: :obj:`typing.Optional[base.Boolean]` - :param reply: True if the message is a reply - :type reply: :obj:`typing.Optional[base.Boolean]` + :param allow_sending_without_reply: Pass True, if the message should be sent + even if the specified replied-to message is not found + :type allow_sending_without_reply: :obj:`typing.Optional[base.Boolean]` :param reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove @@ -1515,6 +1523,9 @@ class Message(base.TelegramObject): types.ReplyKeyboardMarkup, types.ReplyKeyboardRemove, types.ForceReply], None]` + :param reply: True if the message is a reply + :type reply: :obj:`typing.Optional[base.Boolean]` + :return: On success, the sent Message is returned :rtype: :obj:`types.Message` """ @@ -1527,6 +1538,7 @@ class Message(base.TelegramObject): disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, reply_to_message_id=self.message_id if reply else None, + allow_sending_without_reply=allow_sending_without_reply, reply_markup=reply_markup, )