mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +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(
|
||||
channel=entity,
|
||||
user_id=user,
|
||||
banned_rights=types.ChatBannedRights(until_date=None, view_messages=True)
|
||||
),
|
||||
functions.channels.EditBannedRequest(
|
||||
channel=entity,
|
||||
user_id=user,
|
||||
banned_rights=types.ChatBannedRights(until_date=None)
|
||||
),
|
||||
], ordered=True)
|
||||
await self(functions.channels.EditBannedRequest(
|
||||
channel=entity,
|
||||
user_id=user,
|
||||
banned_rights=types.ChatBannedRights(until_date=None, view_messages=True)
|
||||
))
|
||||
await asyncio.sleep(0.5)
|
||||
await self(functions.channels.EditBannedRequest(
|
||||
channel=entity,
|
||||
user_id=user,
|
||||
banned_rights=types.ChatBannedRights(until_date=None)
|
||||
))
|
||||
else:
|
||||
raise ValueError('You must pass either a channel or a chat')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user