Skip to content

Commit bbbc622

Browse files
committed
Adds @message decorator to editMessageText python-telegram-bot#320
1 parent da95341 commit bbbc622

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

telegram/bot.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,14 +1009,14 @@ def answerCallbackQuery(self, callback_query_id, text=None, show_alert=False, **
10091009
return result
10101010

10111011
@log
1012+
@message
10121013
def editMessageText(self,
10131014
text,
10141015
chat_id=None,
10151016
message_id=None,
10161017
inline_message_id=None,
10171018
parse_mode=None,
10181019
disable_web_page_preview=None,
1019-
reply_markup=None,
10201020
**kwargs):
10211021
"""Use this method to edit text messages sent by the bot or via the bot
10221022
(for inline bots).
@@ -1043,6 +1043,10 @@ def editMessageText(self,
10431043
A JSON-serialized object for an inline keyboard.
10441044
10451045
Keyword Args:
1046+
reply_markup (Optional[:class:`telegram.ReplyMarkup`]): Additional
1047+
interface options. A JSON-serialized object for an inline
1048+
keyboard, custom reply keyboard, instructions to hide reply
1049+
keyboard or to force a reply from the user.
10461050
timeout (Optional[float]): If this value is specified, use it as
10471051
the definitive timeout (in seconds) for urlopen() operations.
10481052
@@ -1070,15 +1074,8 @@ def editMessageText(self,
10701074
data['parse_mode'] = parse_mode
10711075
if disable_web_page_preview:
10721076
data['disable_web_page_preview'] = disable_web_page_preview
1073-
if reply_markup:
1074-
if isinstance(reply_markup, ReplyMarkup):
1075-
data['reply_markup'] = reply_markup.to_json()
1076-
else:
1077-
data['reply_markup'] = reply_markup
1078-
1079-
result = request.post(url, data, timeout=kwargs.get('timeout'))
10801077

1081-
return Message.de_json(result)
1078+
return url, data
10821079

10831080
@log
10841081
@message

0 commit comments

Comments
 (0)