X Tutup
Skip to content

Commit bf5ba9a

Browse files
committed
Merge branch 'bot-api-2.0' into dispatcher-rework
2 parents ad21165 + d879a0d commit bf5ba9a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

telegram/bot.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,10 @@ def editMessageText(self,
10191019
if reply_markup:
10201020
data['disable_web_page_preview'] = disable_web_page_preview
10211021
if reply_markup:
1022-
data['reply_markup'] = reply_markup
1022+
if isinstance(reply_markup, ReplyMarkup):
1023+
data['reply_markup'] = reply_markup.to_json()
1024+
else:
1025+
data['reply_markup'] = reply_markup
10231026

10241027
result = request.post(url, data)
10251028

@@ -1066,7 +1069,10 @@ def editMessageCaption(self,
10661069
if inline_message_id:
10671070
data['inline_message_id'] = inline_message_id
10681071
if reply_markup:
1069-
data['reply_markup'] = reply_markup
1072+
if isinstance(reply_markup, ReplyMarkup):
1073+
data['reply_markup'] = reply_markup.to_json()
1074+
else:
1075+
data['reply_markup'] = reply_markup
10701076

10711077
result = request.post(url, data)
10721078

@@ -1101,6 +1107,9 @@ def editMessageReplyMarkup(self,
11011107

11021108
url = '%s/editMessageReplyMarkup' % self.base_url
11031109

1110+
if isinstance(reply_markup, ReplyMarkup):
1111+
reply_markup = reply_markup.to_json()
1112+
11041113
data = {'reply_markup': reply_markup}
11051114

11061115
if chat_id:

0 commit comments

Comments
 (0)
X Tutup