🐛 GetChatMembers: Fix unreached code problem

This commit is contained in:
Sam 2022-01-19 21:58:57 +08:00
parent 04b783281e
commit cafc997df1
Signed by: sam01101
GPG Key ID: 42D7B6D13FF5E611

View File

@ -101,19 +101,8 @@ class GetChatMembers(Scaffold):
"""
peer = await self.resolve_peer(chat_id)
if isinstance(peer, raw.types.InputPeerChat):
r = await self.send(
raw.functions.messages.GetFullChat(
chat_id=peer.chat_id
)
)
members = getattr(r.full_chat.participants, "participants", [])
users = {i.id: i for i in r.users}
return types.List(types.ChatMember._parse(self, member, users, {}) for member in members)
elif isinstance(peer, raw.types.InputPeerChannel):
filter = filter.lower()
if isinstance(peer, (raw.types.InputPeerChannel, raw.types.InputPeerChat)):
filter = filter.lower(),
if filter == Filters.ALL:
filter = raw.types.ChannelParticipantsSearch(q=query)