mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 19:20:09 +03:00
Ignore channel only permissions in megagroups
This commit is contained in:
parent
09f27f0dd7
commit
3b5e939c04
|
@ -873,6 +873,12 @@ class ChatMethods:
|
|||
)
|
||||
|
||||
if isinstance(entity, types.InputPeerChannel):
|
||||
if post_messages or edit_messages:
|
||||
full_entity = await self.get_entity(entity)
|
||||
if full_entity.megagroup:
|
||||
post_messages = None
|
||||
edit_messages = None
|
||||
|
||||
perms = locals()
|
||||
return await self(functions.channels.EditAdminRequest(entity, user, types.ChatAdminRights(**{
|
||||
# A permission is its explicit (not-None) value or `is_admin`.
|
||||
|
|
Loading…
Reference in New Issue
Block a user