Fix kick_participant in channels

Previously it was banning users, presumably due to a server side change. Sleeping for 0 doesn't work but sleeping for 0.1 does, so it will do.
This commit is contained in:
penn5 2019-09-28 08:22:10 +01:00 committed by GitHub
parent 5e6ff67d01
commit 7387dda523
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1085,18 +1085,19 @@ class ChatMethods:
if isinstance(user, types.InputPeerSelf):
await self(functions.channels.LeaveChannelRequest(entity))
else:
await self([
await self(
functions.channels.EditBannedRequest(
channel=entity,
user_id=user,
banned_rights=types.ChatBannedRights(until_date=None, view_messages=True)
),
))
await asyncio.sleep(0.1)
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')