From 3b5e939c049c9421b2b8e0a8c3118f10e08d853a Mon Sep 17 00:00:00 2001 From: YouTwitFace Date: Thu, 10 Oct 2019 16:55:15 -0400 Subject: [PATCH] Ignore channel only permissions in megagroups --- telethon/client/chats.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index b86b4fa5..bbf5fb9f 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -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`.