Fix kick_participant in channels (#1284)

Presumably some server-side change made insta-unbanning no longer work.
This commit is contained in:
penn5 2019-09-28 08:38:41 +01:00 committed by Lonami
parent 5e6ff67d01
commit 88d8424474

View File

@ -1085,18 +1085,17 @@ class ChatMethods:
if isinstance(user, types.InputPeerSelf): if isinstance(user, types.InputPeerSelf):
await self(functions.channels.LeaveChannelRequest(entity)) await self(functions.channels.LeaveChannelRequest(entity))
else: else:
await self([ await self(functions.channels.EditBannedRequest(
functions.channels.EditBannedRequest( channel=entity,
channel=entity, user_id=user,
user_id=user, banned_rights=types.ChatBannedRights(until_date=None, view_messages=True)
banned_rights=types.ChatBannedRights(until_date=None, view_messages=True) ))
), await asyncio.sleep(0.5)
functions.channels.EditBannedRequest( await self(functions.channels.EditBannedRequest(
channel=entity, channel=entity,
user_id=user, user_id=user,
banned_rights=types.ChatBannedRights(until_date=None) banned_rights=types.ChatBannedRights(until_date=None)
), ))
], ordered=True)
else: else:
raise ValueError('You must pass either a channel or a chat') raise ValueError('You must pass either a channel or a chat')