Skip to content

Commit 8a0798f

Browse files
committed
Document about Breaking Changes in the docs.
Fix documentation of download_media
1 parent 0854967 commit 8a0798f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

docs/source/releases/changes-in-this-fork.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
1414
Breaking Changes
1515
=================
1616

17+
- PR `#115 <https://github.com/TelegramPlayGround/pyrogram/pull/115>`_ This `change <https://github.com/pyrogram/pyrogram/pull/966#issuecomment-1108858881>`_ breaks some usages with offset-naive and offset-aware datetimes.
1718
- PR from upstream: `1411 <https://github.com/pyrogram/pyrogram/pull/1411>`_ without attribution.
1819

1920
Changes in this Fork

pyrogram/methods/messages/download_media.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ async def download_media(
9191
Otherwise, in case ``in_memory=True``, a binary file-like object with its attribute ".name" set is returned.
9292
9393
Raises:
94-
ValueError: if the message doesn't contain any downloadable media
94+
RPCError: In case of a Telegram RPC error.
95+
ValueError: If the message doesn't contain any downloadable media.
9596
9697
Example:
9798
Download media to file

pyrogram/types/messages_and_media/message.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5347,11 +5347,15 @@ async def download(
53475347
You can either keep ``*args`` or add every single extra argument in your function signature.
53485348
53495349
Returns:
5350-
On success, the absolute path of the downloaded file as string is returned, None otherwise.
5350+
``str`` | ``None`` | ``BinaryIO``: On success, the absolute path of the downloaded file is returned,
5351+
otherwise, in case the download failed or was deliberately stopped with
5352+
:meth:`~pyrogram.Client.stop_transmission`, None is returned.
5353+
Otherwise, in case ``in_memory=True``, a binary file-like object with its attribute ".name" set is returned.
53515354
53525355
Raises:
53535356
RPCError: In case of a Telegram RPC error.
5354-
``ValueError``: If the message doesn't contain any downloadable media
5357+
ValueError: If the message doesn't contain any downloadable media.
5358+
53555359
"""
53565360
return await self._client.download_media(
53575361
message=self,

0 commit comments

Comments
 (0)