From 3b52e5c49bbafb0d3518d52709f038835468297a Mon Sep 17 00:00:00 2001 From: eternnoir Date: Tue, 3 May 2016 20:59:03 +0800 Subject: [PATCH] ReplyKeyboardMarkup support string. --- telebot/types.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/telebot/types.py b/telebot/types.py index cba36df29..665326f21 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -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 = [] @@ -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