diff --git a/telethon/client/chats.py b/telethon/client/chats.py index 4b6a8ed2..a1aa1aea 100644 --- a/telethon/client/chats.py +++ b/telethon/client/chats.py @@ -1418,17 +1418,21 @@ class ChatMethods: return await self( functions.phone.CreateGroupCallRequest( peer=entity, - schedule=schedule) + schedule_date=schedule) ).updates[0] try: Call = await self( functions.messages.GetFullChatRequest(entity)) - except errors.rpcerrorlist.ChatIdInvalidError: + except errors.rpcerrorslist.ChatIdInvalidError: Call = await self( functions.channels.GetFullChannelRequest(entity)) + + Call = Call.full_chat.call + if method == "edit_title": return (await self(functions.phone.EditGroupCallTitleRequest( Call, title=title if title else ""))).updates + elif method == "edit_perms": reqs = await self( functions.phone.ToggleGroupCallSettingsRequest( @@ -1436,13 +1440,16 @@ class ChatMethods: call=Call, join_muted=join_muted)) return reqs.updates + elif method == "discard": return (await self( functions.phone.DiscardGroupCallRequest(Call))).updates + elif method == "start_schedule": return (await self( functions.phone.StartScheduledGroupCallRequest(Call)) ).updates + else: self._log[__name__].info( "Invalid Method Used while using Modifying GroupCall") diff --git a/telethon/client/downloads.py b/telethon/client/downloads.py index 7d3b0967..be5229d0 100644 --- a/telethon/client/downloads.py +++ b/telethon/client/downloads.py @@ -395,6 +395,11 @@ class DownloadMethods: date = datetime.datetime.now() media = message + if isinstance(media, types.MessageService): + if isinstance(message.action, + types.MessageActionChatEditPhoto): + media = media.photo + if isinstance(media, types.MessageMediaWebPage): if isinstance(media.webpage, types.WebPage): media = media.webpage.document or media.webpage.photo diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index c5d170e5..473a87cd 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -151,10 +151,7 @@ class UploadMethods: * An external URL to a file over the internet. This will send the file as "external" media, and Telegram is the one that will fetch the media and send it. - - * A Bot API-like ``file_id``. You can convert previously - sent media to file IDs for later reusing with - `telethon.utils.pack_bot_file_id`. +. * A handle to an existing file (for example, if you sent a message with media before, you can use its ``message.media`` diff --git a/telethon/tl/custom/file.py b/telethon/tl/custom/file.py index 210eb53d..7758a5c5 100644 --- a/telethon/tl/custom/file.py +++ b/telethon/tl/custom/file.py @@ -18,20 +18,6 @@ class File: def __init__(self, media): self.media = media - @property - def id(self): - """ - The bot-API style ``file_id`` representing this file. - - .. note:: - - This file ID may not work under user accounts, - but should still be usable by bot accounts. - - You can, however, still use it to identify - a file in for example a database. - """ - return utils.pack_bot_file_id(self.media) @property def name(self): diff --git a/telethon_generator/data/errors.csv b/telethon_generator/data/errors.csv index b47a864c..c3b9125c 100644 --- a/telethon_generator/data/errors.csv +++ b/telethon_generator/data/errors.csv @@ -144,7 +144,7 @@ GRAPH_OUTDATED_RELOAD,400,"Data can't be used for the channel statistics, graphs GROUPCALL_FORBIDDEN,403, GROUPCALL_JOIN_MISSING,400, GROUPCALL_SSRC_DUPLICATE_MUCH,400, -GROUPCALL_NOT_MODIFIED,400 +GROUPCALL_NOT_MODIFIED,400, GROUPED_MEDIA_INVALID,400,Invalid grouped media GROUP_CALL_INVALID,400,Group call invalid HASH_INVALID,400,The provided hash is invalid diff --git a/telethon_generator/data/methods.csv b/telethon_generator/data/methods.csv index b6ca1070..34e1cd83 100644 --- a/telethon_generator/data/methods.csv +++ b/telethon_generator/data/methods.csv @@ -313,7 +313,7 @@ phone.discardCall,user,CALL_ALREADY_ACCEPTED CALL_PEER_INVALID phone.getCallConfig,user, phone.inviteToGroupCall,user,GROUPCALL_FORBIDDEN phone.joinGroupCall,user,GROUPCALL_SSRC_DUPLICATE_MUCH -phone.joinGroupCallPresentation,403, PARTICIPANT_JOIN_MISSING +phone.joinGroupCallPresentation,user, PARTICIPANT_JOIN_MISSING phone.receivedCall,user,CALL_ALREADY_DECLINED CALL_PEER_INVALID phone.requestCall,user,CALL_PROTOCOL_FLAGS_INVALID PARTICIPANT_CALL_FAILED PARTICIPANT_VERSION_OUTDATED USER_ID_INVALID USER_IS_BLOCKED USER_PRIVACY_RESTRICTED phone.saveCallDebug,user,CALL_PEER_INVALID DATA_JSON_INVALID