From a9437db80cac0e484affc085d06d259a3e57e54a Mon Sep 17 00:00:00 2001 From: YouTwitFace Date: Fri, 11 Oct 2019 11:27:08 -0400 Subject: [PATCH] Add a comment --- telethon/client/chats.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telethon/client/chats.py b/telethon/client/chats.py index bbf5fb9f..1d42b40e 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -873,6 +873,9 @@ class ChatMethods: ) if isinstance(entity, types.InputPeerChannel): + # If we try to set these permissions in a megagroup, we + # would get a RIGHT_FORBIDDEN. However, it makes sense + # that an admin can post messages, so we want to avoid the error if post_messages or edit_messages: full_entity = await self.get_entity(entity) if full_entity.megagroup: