From 9ab906e60ccbcba7a445d9dac5d4be215cecdd3b Mon Sep 17 00:00:00 2001 From: meoww-bot <14239840+meoww-bot@users.noreply.github.com> Date: Wed, 2 Sep 2020 18:09:14 +0800 Subject: [PATCH] fix: simplify code json.loads(button.to_json()) equals to button.to_dict() --- telebot/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/types.py b/telebot/types.py index 0c9b99e..f1b9af0 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -1021,7 +1021,7 @@ class InlineKeyboardMarkup(Dictionaryable, JsonSerializable, JsonDeserializable) def to_dict(self): json_dict = dict() - json_dict['inline_keyboard'] = [[json.loads(button.to_json()) for button in row] for row in self.keyboard] + json_dict['inline_keyboard'] = [[button.to_dict() for button in row] for row in self.keyboard] return json_dict