mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 10:53:44 +03:00
Fix kick_participant in channels (#1284)
Presumably some server-side change made insta-unbanning no longer work.
This commit is contained in:
parent
5e6ff67d01
commit
88d8424474
|
@ -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')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user