diff --git a/README.md b/README.md index dd68f7b..14f085a 100644 --- a/README.md +++ b/README.md @@ -312,7 +312,7 @@ itembtn3 = types.KeyboardButton('d') markup.add(itembtn1, itembtn2, itembtn3) tb.send_message(chat_id, "Choose one letter:", reply_markup=markup) -# or add strings one row at a time: +# or add KeyboardButton one row at a time: markup = types.ReplyKeyboardMarkup() itembtna = types.KeyboardButton('a') itembtnv = types.KeyboardButton('v') diff --git a/telebot/types.py b/telebot/types.py index c6f7d10..993307d 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -564,7 +564,10 @@ class ReplyKeyboardMarkup(JsonSerializable): :param args: strings :return: self, to allow function chaining. """ - self.keyboard.append(args) + btn_array = [] + for button in args: + btn_array.append(button.to_dic()) + self.keyboard.append(btn_array) return self def to_json(self): @@ -638,7 +641,10 @@ class InlineKeyboardMarkup(Dictionaryable, JsonSerializable): :param args: strings :return: self, to allow function chaining. """ - self.keyboard.append(args) + btn_array = [] + for button in args: + btn_array.append(button.to_dic()) + self.keyboard.append(btn_array) return self def to_json(self): @@ -1296,6 +1302,7 @@ class InlineQueryResultCachedMpeg4Gif(BaseInlineQueryResultCached): self.input_message_content = input_message_content self.payload_dic['mpeg4_file_id'] = mpeg4_file_id + class InlineQueryResultCachedSticker(BaseInlineQueryResultCached): def __init__(self, id, sticker_file_id, reply_markup=None, input_message_content=None): BaseInlineQueryResultCached.__init__(self)