mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-31 02:09:58 +03:00
Commit
This commit is contained in:
parent
3436e4e57d
commit
3692f56a32
|
@ -1418,17 +1418,21 @@ class ChatMethods:
|
||||||
return await self(
|
return await self(
|
||||||
functions.phone.CreateGroupCallRequest(
|
functions.phone.CreateGroupCallRequest(
|
||||||
peer=entity,
|
peer=entity,
|
||||||
schedule=schedule)
|
schedule_date=schedule)
|
||||||
).updates[0]
|
).updates[0]
|
||||||
try:
|
try:
|
||||||
Call = await self(
|
Call = await self(
|
||||||
functions.messages.GetFullChatRequest(entity))
|
functions.messages.GetFullChatRequest(entity))
|
||||||
except errors.rpcerrorlist.ChatIdInvalidError:
|
except errors.rpcerrorslist.ChatIdInvalidError:
|
||||||
Call = await self(
|
Call = await self(
|
||||||
functions.channels.GetFullChannelRequest(entity))
|
functions.channels.GetFullChannelRequest(entity))
|
||||||
|
|
||||||
|
Call = Call.full_chat.call
|
||||||
|
|
||||||
if method == "edit_title":
|
if method == "edit_title":
|
||||||
return (await self(functions.phone.EditGroupCallTitleRequest(
|
return (await self(functions.phone.EditGroupCallTitleRequest(
|
||||||
Call, title=title if title else ""))).updates
|
Call, title=title if title else ""))).updates
|
||||||
|
|
||||||
elif method == "edit_perms":
|
elif method == "edit_perms":
|
||||||
reqs = await self(
|
reqs = await self(
|
||||||
functions.phone.ToggleGroupCallSettingsRequest(
|
functions.phone.ToggleGroupCallSettingsRequest(
|
||||||
|
@ -1436,13 +1440,16 @@ class ChatMethods:
|
||||||
call=Call,
|
call=Call,
|
||||||
join_muted=join_muted))
|
join_muted=join_muted))
|
||||||
return reqs.updates
|
return reqs.updates
|
||||||
|
|
||||||
elif method == "discard":
|
elif method == "discard":
|
||||||
return (await self(
|
return (await self(
|
||||||
functions.phone.DiscardGroupCallRequest(Call))).updates
|
functions.phone.DiscardGroupCallRequest(Call))).updates
|
||||||
|
|
||||||
elif method == "start_schedule":
|
elif method == "start_schedule":
|
||||||
return (await self(
|
return (await self(
|
||||||
functions.phone.StartScheduledGroupCallRequest(Call))
|
functions.phone.StartScheduledGroupCallRequest(Call))
|
||||||
).updates
|
).updates
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self._log[__name__].info(
|
self._log[__name__].info(
|
||||||
"Invalid Method Used while using Modifying GroupCall")
|
"Invalid Method Used while using Modifying GroupCall")
|
||||||
|
|
|
@ -395,6 +395,11 @@ class DownloadMethods:
|
||||||
date = datetime.datetime.now()
|
date = datetime.datetime.now()
|
||||||
media = message
|
media = message
|
||||||
|
|
||||||
|
if isinstance(media, types.MessageService):
|
||||||
|
if isinstance(message.action,
|
||||||
|
types.MessageActionChatEditPhoto):
|
||||||
|
media = media.photo
|
||||||
|
|
||||||
if isinstance(media, types.MessageMediaWebPage):
|
if isinstance(media, types.MessageMediaWebPage):
|
||||||
if isinstance(media.webpage, types.WebPage):
|
if isinstance(media.webpage, types.WebPage):
|
||||||
media = media.webpage.document or media.webpage.photo
|
media = media.webpage.document or media.webpage.photo
|
||||||
|
|
|
@ -151,10 +151,7 @@ class UploadMethods:
|
||||||
* An external URL to a file over the internet. This will
|
* An external URL to a file over the internet. This will
|
||||||
send the file as "external" media, and Telegram is the
|
send the file as "external" media, and Telegram is the
|
||||||
one that will fetch the media and send it.
|
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
|
* A handle to an existing file (for example, if you sent a
|
||||||
message with media before, you can use its ``message.media``
|
message with media before, you can use its ``message.media``
|
||||||
|
|
|
@ -18,20 +18,6 @@ class File:
|
||||||
def __init__(self, media):
|
def __init__(self, media):
|
||||||
self.media = 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
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
|
|
@ -144,7 +144,7 @@ GRAPH_OUTDATED_RELOAD,400,"Data can't be used for the channel statistics, graphs
|
||||||
GROUPCALL_FORBIDDEN,403,
|
GROUPCALL_FORBIDDEN,403,
|
||||||
GROUPCALL_JOIN_MISSING,400,
|
GROUPCALL_JOIN_MISSING,400,
|
||||||
GROUPCALL_SSRC_DUPLICATE_MUCH,400,
|
GROUPCALL_SSRC_DUPLICATE_MUCH,400,
|
||||||
GROUPCALL_NOT_MODIFIED,400
|
GROUPCALL_NOT_MODIFIED,400,
|
||||||
GROUPED_MEDIA_INVALID,400,Invalid grouped media
|
GROUPED_MEDIA_INVALID,400,Invalid grouped media
|
||||||
GROUP_CALL_INVALID,400,Group call invalid
|
GROUP_CALL_INVALID,400,Group call invalid
|
||||||
HASH_INVALID,400,The provided hash is invalid
|
HASH_INVALID,400,The provided hash is invalid
|
||||||
|
|
Can't render this file because it has a wrong number of fields in line 147.
|
|
@ -313,7 +313,7 @@ phone.discardCall,user,CALL_ALREADY_ACCEPTED CALL_PEER_INVALID
|
||||||
phone.getCallConfig,user,
|
phone.getCallConfig,user,
|
||||||
phone.inviteToGroupCall,user,GROUPCALL_FORBIDDEN
|
phone.inviteToGroupCall,user,GROUPCALL_FORBIDDEN
|
||||||
phone.joinGroupCall,user,GROUPCALL_SSRC_DUPLICATE_MUCH
|
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.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.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
|
phone.saveCallDebug,user,CALL_PEER_INVALID DATA_JSON_INVALID
|
||||||
|
|
|
Loading…
Reference in New Issue
Block a user