diff --git a/telebot/types.py b/telebot/types.py index f1b9af0..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,13 +964,13 @@ 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): """ 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: