diff --git a/telethon/client/chats.py b/telethon/client/chats.py index f898bdab..6ef0f946 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -1313,4 +1313,27 @@ class ChatMethods: finally: await self._return_exported_sender(sender) - # endregion + async def change_groupcall(method:str, + chat, + title:str=None): + if not method: + return + if method == "create": + InputPeer = utils.get_input_peer(chat) + return await self( + functions.phone.CreateGroupCallRequest(peer=InputPeer) + ) + try: + Call = (await self(functions.messages.GetFullChatRequest(chat))).full_chat.call + except errors.rpcerrorlist.ChatIdInvalidError: + Call = (await self(functions.channels.GetFullChannelRequest(chat))).full_chat.call + if method == "edit_title": + return await self(functions.phone.EditGroupCallTitleRequest(Call, title=title)) + elif method == "discard": + return await self(functions.phone.DiscardGroupCallRequest(call)) + else: + self._log[__name__].info("Invalid Method Invoked while using change_groupcall") + + + + # endregion \ No newline at end of file diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index f52f61ca..7d3b0967 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -269,7 +269,7 @@ class DownloadMethods: photo = entity.photo - if isinstance(photo, (types.UserProfilePhoto, types.)): + if isinstance(photo, (types.UserProfilePhoto, types.ChatPhoto)): dc_id = photo.dc_id loc = types.InputPeerPhotoFileLocation( peer=await self.get_input_entity(entity),