mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
ReplyKeyboardMarkup support string.
This commit is contained in:
parent
700b869555
commit
3b52e5c49b
@ -548,7 +548,10 @@ class ReplyKeyboardMarkup(JsonSerializable):
|
|||||||
i = 1
|
i = 1
|
||||||
row = []
|
row = []
|
||||||
for button in args:
|
for button in args:
|
||||||
row.append(button.to_dic())
|
if isinstance(button, str):
|
||||||
|
row.append({'text': button})
|
||||||
|
else:
|
||||||
|
row.append(button.to_dic())
|
||||||
if i % self.row_width == 0:
|
if i % self.row_width == 0:
|
||||||
self.keyboard.append(row)
|
self.keyboard.append(row)
|
||||||
row = []
|
row = []
|
||||||
@ -566,7 +569,10 @@ class ReplyKeyboardMarkup(JsonSerializable):
|
|||||||
"""
|
"""
|
||||||
btn_array = []
|
btn_array = []
|
||||||
for button in args:
|
for button in args:
|
||||||
btn_array.append(button.to_dic())
|
if isinstance(button, str):
|
||||||
|
btn_array.append({'text': button})
|
||||||
|
else:
|
||||||
|
btn_array.append(button.to_dic())
|
||||||
self.keyboard.append(btn_array)
|
self.keyboard.append(btn_array)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user