mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +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):
|
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')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user