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):
await self(functions.channels.LeaveChannelRequest(entity))
else:
await self([
functions.channels.EditBannedRequest(
await self(functions.channels.EditBannedRequest(
channel=entity,
user_id=user,
banned_rights=types.ChatBannedRights(until_date=None, view_messages=True)
),
functions.channels.EditBannedRequest(
))
await asyncio.sleep(0.5)
await self(functions.channels.EditBannedRequest(
channel=entity,
user_id=user,
banned_rights=types.ChatBannedRights(until_date=None)
),
], ordered=True)
))
else:
raise ValueError('You must pass either a channel or a chat')