From 468a535257efdf32c69bd7bea4136ac94d501fbc Mon Sep 17 00:00:00 2001 From: eternnoir Date: Tue, 7 Jun 2016 19:08:52 +0800 Subject: [PATCH] Fix de_json. --- telebot/__init__.py | 5 ++++- telebot/types.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/telebot/__init__.py b/telebot/__init__.py index aa837f9..05ae34e 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -295,7 +295,10 @@ class TeleBot: def get_chat_administrators(self, chat_id): result = apihelper.get_chat_administrators(self.token, chat_id) - return [[types.ChatMember.de_json(y) for y in x] for x in result] + ret = [] + for r in result: + ret.append(types.ChatMember.de_json(r)) + return ret def get_chat_members_count(self, chat_id): result = apihelper.get_chat_members_count(self.token, chat_id) diff --git a/telebot/types.py b/telebot/types.py index c6f9b6e..7906467 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -727,7 +727,7 @@ class ChatMember(JsonDeserializable): obj = cls.check_json(json_type) user = User.de_json(obj['user']) status = obj['status'] - return cls(id, user, status) + return cls(user, status) def __init__(self, user, status): self.user = user