Skip to content

Commit

Permalink
ReplyKeyboardMarkup support string.
Browse files Browse the repository at this point in the history
  • Loading branch information
eternnoir committed May 3, 2016
1 parent 700b869 commit 3b52e5c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,10 @@ def add(self, *args):
i = 1
row = []
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:
self.keyboard.append(row)
row = []
Expand All @@ -566,7 +569,10 @@ def row(self, *args):
"""
btn_array = []
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)
return self

Expand Down

0 comments on commit 3b52e5c

Please sign in to comment.