This commit is contained in:
eternnoir 2016-04-25 23:54:30 +08:00
parent e6105d851c
commit 0eb21aa673
2 changed files with 10 additions and 3 deletions

View File

@ -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')

View File

@ -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)