This commit is contained in:
New-dev0 2021-06-11 18:55:19 +05:30
parent 267519f8f0
commit e9819de123
2 changed files with 8 additions and 5 deletions

View File

@ -162,7 +162,7 @@ class _ParticipantsIter(RequestIter):
users = {user.id: user for user in full.users}
for participant in full.full_chat.participants.participants:
if isinstance(participant, types.ChannelParticipantsBanned):
if isinstance(participant, types.ChannelParticipantBanned):
user_id = participant.peer.user_id
else:
user_id = participant.user_id
@ -212,7 +212,7 @@ class _ParticipantsIter(RequestIter):
users = {user.id: user for user in participants.users}
for participant in participants.participants:
if isinstance(participant, types.ChannelParticipantsBanned):
if isinstance(participant, types.ChannelParticipantBanned):
user_id = participant.peer.user_id
else:
user_id = participant.user_id
@ -511,7 +511,7 @@ class ChatMethods:
await client.get_participant(chat, user)
"""
chat = await self.get_input_entity(chat)
user = await self.get_input_entity(user)
user = await self.get_input_entity(entity)
return await self(functions.channels.GetParticipantRequest(
channel=chat,
participant=user)
@ -1260,7 +1260,6 @@ class ChatMethods:
# Get Banned Permissions of Chat
await client.get_permissions(chat)
"""
entity = await self.get_input_entity(entity)
if not user:
if isinstance(entity, types.Channel):
FullChat = await self(functions.channels.GetFullChannelRequest(entity))
@ -1269,6 +1268,8 @@ class ChatMethods:
else:
return
return FullChat.chats[0].default_banned_rights
entity = await self.get_input_entity(entity)
user = await self.get_input_entity(user)
if helpers._entity_type(user) != helpers._EntityType.USER:
raise ValueError('You must pass a user entity')
@ -1464,7 +1465,7 @@ class ChatMethods:
try:
Call = await self(
functions.messages.GetFullChatRequest(entity))
except errors.rpcerrorslist.ChatIdInvalidError:
except errors.rpcerrorlist.ChatIdInvalidError:
Call = await self(
functions.channels.GetFullChannelRequest(entity))

View File

@ -11,6 +11,8 @@ chats.ChatMethods,edit_admin,channels.editAdmin messages.editChatAdmin
chats.ChatMethods,edit_permissions,channels.editBanned messages.editChatDefaultBannedRights
chats.ChatMethods,iter_participants,channels.getParticipants
chats.ChatMethods,iter_admin_log,channels.getAdminLog
chats.ChatMethods,get_participant, channels.getParticipant
chats.ChatMethods,modify_groupcall, phone.createGroupCall phone.discardGroupCall phone.toggleGroupCallSettings phone.startScheduledGroupCall phone.editGroupCallTitle
dialogs.DialogMethods,iter_dialogs,messages.getDialogs
dialogs.DialogMethods,iter_drafts,messages.getAllDrafts
dialogs.DialogMethods,edit_folder,folders.deleteFolder folders.editPeerFolders

1 ns friendly raw
11 chats.ChatMethods edit_permissions channels.editBanned messages.editChatDefaultBannedRights
12 chats.ChatMethods iter_participants channels.getParticipants
13 chats.ChatMethods iter_admin_log channels.getAdminLog
14 chats.ChatMethods get_participant channels.getParticipant
15 chats.ChatMethods modify_groupcall phone.createGroupCall phone.discardGroupCall phone.toggleGroupCallSettings phone.startScheduledGroupCall phone.editGroupCallTitle
16 dialogs.DialogMethods iter_dialogs messages.getDialogs
17 dialogs.DialogMethods iter_drafts messages.getAllDrafts
18 dialogs.DialogMethods edit_folder folders.deleteFolder folders.editPeerFolders