1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fix de_json.

This commit is contained in:
eternnoir 2016-06-07 19:08:52 +08:00
parent d2e7f4d8f2
commit 468a535257
2 changed files with 5 additions and 2 deletions

View File

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

View File

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