Expand docs on migration guide

This commit is contained in:
Lonami Exo
2023-09-16 19:13:00 +02:00
parent 22f15303a5
commit 495de58925
9 changed files with 321 additions and 9 deletions

View File

@@ -384,6 +384,8 @@ class Client:
:param file:
The output file path or :term:`file-like object`.
Note that the extension is not automatically added to the path.
You can get the file extension with :attr:`telethon.types.File.ext`.
.. rubric:: Example
@@ -1020,8 +1022,8 @@ class Client:
async def send_message(
self,
chat: ChatLike,
*,
text: Optional[str] = None,
*,
markdown: Optional[str] = None,
html: Optional[str] = None,
link_preview: Optional[bool] = None,
@@ -1046,7 +1048,7 @@ class Client:
return await send_message(
self,
chat,
text=text,
text,
markdown=markdown,
html=html,
link_preview=link_preview,

View File

@@ -273,7 +273,7 @@ async def upload(
async def iter_download(self: Client) -> None:
pass
raise NotImplementedError
# result = self(
# functions.upload.get_file(
# precise=False,
@@ -291,4 +291,4 @@ async def iter_download(self: Client) -> None:
async def download(self: Client, media: MediaLike, file: OutFileLike) -> None:
pass
raise NotImplementedError

View File

@@ -38,8 +38,8 @@ def parse_message(
async def send_message(
self: Client,
chat: ChatLike,
*,
text: Optional[str] = None,
*,
markdown: Optional[str] = None,
html: Optional[str] = None,
link_preview: Optional[bool] = None,

View File

@@ -295,5 +295,9 @@ class File(metaclass=NoPublicConstructor):
raw=None,
)
@property
def ext(self):
raise NotImplementedError
async def _read(self, n: int) -> bytes:
raise NotImplementedError

View File

@@ -33,11 +33,11 @@ class Message(metaclass=NoPublicConstructor):
return getattr(self._raw, "message", None)
@property
def html_text(self) -> Optional[str]:
def text_html(self) -> Optional[str]:
raise NotImplementedError
@property
def markdown_text(self) -> Optional[str]:
def text_markdown(self) -> Optional[str]:
raise NotImplementedError
@property