Skip to content

Commit 468a535

Browse files
committed
Fix de_json.
1 parent d2e7f4d commit 468a535

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

telebot/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ def leave_chat(self, chat_id):
295295

296296
def get_chat_administrators(self, chat_id):
297297
result = apihelper.get_chat_administrators(self.token, chat_id)
298-
return [[types.ChatMember.de_json(y) for y in x] for x in result]
298+
ret = []
299+
for r in result:
300+
ret.append(types.ChatMember.de_json(r))
301+
return ret
299302

300303
def get_chat_members_count(self, chat_id):
301304
result = apihelper.get_chat_members_count(self.token, chat_id)

telebot/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def de_json(cls, json_type):
727727
obj = cls.check_json(json_type)
728728
user = User.de_json(obj['user'])
729729
status = obj['status']
730-
return cls(id, user, status)
730+
return cls(user, status)
731731

732732
def __init__(self, user, status):
733733
self.user = user

0 commit comments

Comments
 (0)