mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-10 18:55:57 +00:00
Update to layer 89
This breaks edit_2fa
This commit is contained in:
@@ -454,6 +454,8 @@ class AuthMethods(MessageParseMethods, UserMethods):
|
||||
Returns:
|
||||
``True`` if successful, ``False`` otherwise.
|
||||
"""
|
||||
raise NotImplemented
|
||||
|
||||
if new_password is None and current_password is None:
|
||||
return False
|
||||
|
||||
|
||||
@@ -50,6 +50,10 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
||||
Whether this message is a post in a broadcast
|
||||
channel or not.
|
||||
|
||||
from_scheduled (`bool`):
|
||||
Whether this message was originated from
|
||||
a scheduled one or not.
|
||||
|
||||
to_id (:tl:`Peer`):
|
||||
The peer to which this message was sent, which is either
|
||||
:tl:`PeerUser`, :tl:`PeerChat` or :tl:`PeerChannel`. This
|
||||
@@ -138,7 +142,7 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
||||
# For Message (flags)
|
||||
fwd_from=None, via_bot_id=None, media=None, reply_markup=None,
|
||||
entities=None, views=None, edit_date=None, post_author=None,
|
||||
grouped_id=None,
|
||||
grouped_id=None, from_scheduled=None,
|
||||
|
||||
# For MessageAction (mandatory)
|
||||
action=None):
|
||||
@@ -165,6 +169,7 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
||||
self.edit_date = edit_date
|
||||
self.post_author = post_author
|
||||
self.grouped_id = grouped_id
|
||||
self.from_scheduled = from_scheduled
|
||||
self.action = action
|
||||
|
||||
# Convenient storage for custom functions
|
||||
|
||||
+14
-8
@@ -268,7 +268,8 @@ def get_input_photo(photo):
|
||||
photo = photo.photo
|
||||
|
||||
if isinstance(photo, types.Photo):
|
||||
return types.InputPhoto(id=photo.id, access_hash=photo.access_hash)
|
||||
return types.InputPhoto(id=photo.id, access_hash=photo.access_hash,
|
||||
file_reference=photo.file_reference)
|
||||
|
||||
if isinstance(photo, types.PhotoEmpty):
|
||||
return types.InputPhotoEmpty()
|
||||
@@ -577,7 +578,9 @@ def get_input_location(location):
|
||||
|
||||
if isinstance(location, types.Document):
|
||||
return (location.dc_id, types.InputDocumentFileLocation(
|
||||
location.id, location.access_hash, location.version))
|
||||
location.id, location.access_hash,
|
||||
file_reference=location.file_reference
|
||||
))
|
||||
elif isinstance(location, types.Photo):
|
||||
try:
|
||||
location = next(
|
||||
@@ -587,10 +590,13 @@ def get_input_location(location):
|
||||
except StopIteration:
|
||||
pass
|
||||
|
||||
if isinstance(location, (
|
||||
types.FileLocation, types.FileLocationUnavailable)):
|
||||
return (getattr(location, 'dc_id', None), types.InputFileLocation(
|
||||
location.volume_id, location.local_id, location.secret))
|
||||
if isinstance(location, types.FileLocation):
|
||||
return (location.dc_id, types.InputFileLocation(
|
||||
location.volume_id, location.local_id, location.secret,
|
||||
file_reference=location.file_reference
|
||||
))
|
||||
elif isinstance(location, types.FileLocationUnavailable):
|
||||
raise TypeError('Unavailable location cannot be used as input')
|
||||
|
||||
_raise_cast_fail(location, 'InputFileLocation')
|
||||
|
||||
@@ -890,8 +896,8 @@ def resolve_bot_file_id(file_id):
|
||||
size=0,
|
||||
thumb=types.PhotoSizeEmpty('s'),
|
||||
dc_id=dc_id,
|
||||
version=0,
|
||||
attributes=attributes
|
||||
attributes=attributes,
|
||||
file_reference=b''
|
||||
)
|
||||
elif len(data) == 44:
|
||||
(file_type, dc_id, media_id, access_hash,
|
||||
|
||||
Reference in New Issue
Block a user