mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-08 09:51:57 +00:00
Update to layer 76
This commit is contained in:
@@ -1083,6 +1083,7 @@ class TelegramClient(TelegramBareClient):
|
||||
limit=1,
|
||||
max_id=max_id,
|
||||
min_id=min_id,
|
||||
hash=0,
|
||||
from_id=self.get_input_entity(from_user) if from_user else None
|
||||
)
|
||||
else:
|
||||
|
||||
+19
-1
@@ -26,7 +26,7 @@ from .tl.types import (
|
||||
FileLocationUnavailable, InputMediaUploadedDocument, ChannelFull,
|
||||
InputMediaUploadedPhoto, DocumentAttributeFilename, photos,
|
||||
TopPeer, InputNotifyPeer, InputMessageID, InputFileLocation,
|
||||
InputDocumentFileLocation, PhotoSizeEmpty
|
||||
InputDocumentFileLocation, PhotoSizeEmpty, InputDialogPeer
|
||||
)
|
||||
from .tl.types.contacts import ResolvedPeer
|
||||
|
||||
@@ -182,6 +182,24 @@ def get_input_user(entity):
|
||||
_raise_cast_fail(entity, 'InputUser')
|
||||
|
||||
|
||||
def get_input_dialog(dialog):
|
||||
"""Similar to :meth:`get_input_peer`, but for dialogs"""
|
||||
try:
|
||||
if dialog.SUBCLASS_OF_ID == 0xa21c9795: # crc32(b'InputDialogPeer')
|
||||
return dialog
|
||||
if dialog.SUBCLASS_OF_ID == 0xc91c90b6: # crc32(b'InputPeer')
|
||||
return InputDialogPeer(dialog)
|
||||
except AttributeError:
|
||||
_raise_cast_fail(dialog, 'InputDialogPeer')
|
||||
|
||||
try:
|
||||
return InputDialogPeer(get_input_peer(dialog))
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
_raise_cast_fail(dialog, 'InputDialogPeer')
|
||||
|
||||
|
||||
def get_input_document(document):
|
||||
"""Similar to :meth:`get_input_peer`, but for documents"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user