From 376d6fea6c6b08b587b2701dc396bc8a25bcbdb5 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Sun, 8 Nov 2020 13:22:10 +0300 Subject: [PATCH] AIOG-T-93 added allow_sending_without_reply to send_photo shortcuts --- aiogram/types/message.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/aiogram/types/message.py b/aiogram/types/message.py index e5526085..abe5e857 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -348,6 +348,7 @@ class Message(base.TelegramObject): caption: typing.Union[base.String, None] = None, parse_mode: typing.Union[base.String, None] = None, disable_notification: typing.Union[base.Boolean, None] = None, + allow_sending_without_reply: typing.Optional[base.Boolean] = None, reply_markup: typing.Union[ InlineKeyboardMarkup, ReplyKeyboardMarkup, @@ -364,19 +365,29 @@ class Message(base.TelegramObject): :param photo: Photo to send :type photo: :obj:`typing.Union[base.InputFile, base.String]` + :param caption: Photo caption (may also be used when resending photos by file_id), 0-1024 characters :type caption: :obj:`typing.Union[base.String, None]` + :param parse_mode: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. :type parse_mode: :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 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 reply keyboard or to force a reply from the user :type reply_markup: :obj:`typing.Union[types.InlineKeyboardMarkup, types.ReplyKeyboardMarkup, types.ReplyKeyboardRemove, types.ForceReply, None]` + :param reply: fill 'reply_to_message_id' :type reply: :obj:`base.Boolean` + :return: On success, the sent Message is returned :rtype: :obj:`types.Message` """ @@ -387,6 +398,7 @@ class Message(base.TelegramObject): parse_mode=parse_mode, 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, ) @@ -1163,6 +1175,7 @@ class Message(base.TelegramObject): caption: typing.Union[base.String, None] = None, parse_mode: typing.Union[base.String, None] = None, disable_notification: typing.Union[base.Boolean, None] = None, + allow_sending_without_reply: typing.Optional[base.Boolean] = None, reply_markup: typing.Union[ InlineKeyboardMarkup, ReplyKeyboardMarkup, @@ -1179,19 +1192,29 @@ class Message(base.TelegramObject): :param photo: Photo to send :type photo: :obj:`typing.Union[base.InputFile, base.String]` + :param caption: Photo caption (may also be used when resending photos by file_id), 0-1024 characters :type caption: :obj:`typing.Union[base.String, None]` + :param parse_mode: Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. :type parse_mode: :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 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 reply keyboard or to force a reply from the user :type reply_markup: :obj:`typing.Union[types.InlineKeyboardMarkup, types.ReplyKeyboardMarkup, types.ReplyKeyboardRemove, types.ForceReply, None]` + :param reply: fill 'reply_to_message_id' :type reply: :obj:`base.Boolean` + :return: On success, the sent Message is returned :rtype: :obj:`types.Message` """ @@ -1202,6 +1225,7 @@ class Message(base.TelegramObject): parse_mode=parse_mode, 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, )