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,6 +548,9 @@ class ReplyKeyboardMarkup(JsonSerializable):
|
||||
i = 1
|
||||
row = []
|
||||
for button in args:
|
||||
if isinstance(button, str):
|
||||
row.append({'text': button})
|
||||
else:
|
||||
row.append(button.to_dic())
|
||||
if i % self.row_width == 0:
|
||||
self.keyboard.append(row)
|
||||
@ -566,6 +569,9 @@ class ReplyKeyboardMarkup(JsonSerializable):
|
||||
"""
|
||||
btn_array = []
|
||||
for button in args:
|
||||
if isinstance(button, str):
|
||||
btn_array.append({'text': button})
|
||||
else:
|
||||
btn_array.append(button.to_dic())
|
||||
self.keyboard.append(btn_array)
|
||||
return self
|
||||
|
Loading…
Reference in New Issue
Block a user