fix: simplify code

json.loads(button.to_json()) equals to button.to_dict()
This commit is contained in:
meoww-bot 2020-09-02 18:09:14 +08:00 committed by GitHub
parent 698b4371e6
commit 9ab906e60c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

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