From 75a5dd14928a33470e8892b2d72e28d9260a1151 Mon Sep 17 00:00:00 2001 From: Badiboy Date: Tue, 22 Sep 2020 01:34:49 +0300 Subject: [PATCH 1/2] Minor bugfix --- telebot/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/types.py b/telebot/types.py index 55689a6..2d004fa 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -945,7 +945,7 @@ class InlineKeyboardMarkup(Dictionaryable, JsonSerializable): """ This method adds buttons to the keyboard without exceeding row_width. - E.g. InlineKeyboardMarkup#add("A", "B", "C") yields the json result: + E.g. InlineKeyboardMarkup.add("A", "B", "C") yields the json result: {keyboard: [["A"], ["B"], ["C"]]} when row_width is set to 1. When row_width is set to 2, the result: From 00c2e9b51c1ac971848d48c28b3455a182c688a2 Mon Sep 17 00:00:00 2001 From: Badiboy Date: Tue, 22 Sep 2020 01:41:51 +0300 Subject: [PATCH 2/2] Piece death fix --- telebot/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/types.py b/telebot/types.py index 3519533..3845532 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -951,7 +951,7 @@ class InlineKeyboardMarkup(Dictionaryable, JsonSerializable, JsonDeserializable) keyboard = [[InlineKeyboardButton.de_json(button) for button in row] for row in obj['inline_keyboard']] return cls(keyboard) - def __init__(self, keyboard=[] ,row_width=3): + def __init__(self, keyboard=None ,row_width=3): """ This object represents an inline keyboard that appears right next to the message it belongs to. @@ -964,7 +964,7 @@ class InlineKeyboardMarkup(Dictionaryable, JsonSerializable, JsonDeserializable) row_width = self.max_row_keys self.row_width = row_width - self.keyboard = keyboard + self.keyboard = keyboard if keyboard else [] def add(self, *args, row_width=None): """