Skip to content

Commit

Permalink
Update Pyrogram to v2.1.32.4
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Jun 1, 2024
1 parent 1080d84 commit 6141eed
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 26 deletions.
21 changes: 3 additions & 18 deletions docs/source/releases/changes-in-this-fork.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,11 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
| PmOItrOAe |
+-------------+

- Renamed ``placeholder`` to ``input_field_placeholder`` in :obj:`~pyrogram.types.ForceReply`.
- Renamed ``placeholder`` to ``input_field_placeholder`` in :obj:`~pyrogram.types.ForceReply` and :obj:`~pyrogram.types.ReplyKeyboardMarkup`.
- Add ``link`` parameter in :meth:`~pyrogram.Client.get_messages`
- `fix(filters): add type hints in filters.py <https://github.com/TelegramPlayGround/pyrogram/pull/8>`_
- Documentation Builder Fixes
- `faster-pyrogram <https://github.com/cavallium/faster-pyrogram>`_ is not polished or documented for anyone else's use. We don't have the capacity to support `faster-pyrogram <https://github.com/TelegramPlayGround/pyrogram/pull/6>`_ as an independent open-source project, nor any desire for it to become an alternative to Pyrogram. Our goal in making this code available is a unified faster Pyrogram. `... <https://github.com/cavallium/faster-pyrogram/blob/b781909/README.md#L28>`_
- Lock-free and asynchronous implementation of the sqlite session.
- The possibility of turning off journaling and vacuum when starting a session.
- Improved implementation of rle_encode.
- Implementation of _parse_channel_chat without getattr, in some scenarios.
- Cache of FileId and UniqueFileId instances and of their string-coded versions.
- Use of tcp abridged instead of tcp obfuscated as the default protocol.

+-----------------------------+
| Leaked Scheme Layers (2) |
Expand All @@ -176,7 +170,6 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
- `#1345 <https://github.com/pyrogram/pyrogram/issues/1345>`_
- `Add undocumented things <https://github.com/TelegramPlayGround/pyrogram/commit/8a72939d98f343eae1e07981f95769efaa741e4e>`_
- `Add missing enums.SentCodeType <https://github.com/KurimuzonAkuma/pyrogram/commit/40ddcbca6062f13958f4ca2c9852f8d1c4d62f3c>`_
- Renamed ``placeholder`` to ``input_field_placeholder`` in :obj:`~pyrogram.types.ReplyKeyboardMarkup`
- `#693 <https://github.com/KurimuzonAkuma/pyrogram/pull/693>`_
- Revert `e678c05 <https://github.com/TelegramPlayGround/pyrogram/commit/e678c054d4aa0bbbb7d583eb426ca8753a4c9354>`_ and stole squashed unauthored changes from `bcd18d5 <https://github.com/Masterolic/pyrogram/commit/bcd18d5e04f18f949389a03f309816d6f0f9eabe>`_

Expand Down Expand Up @@ -220,9 +213,8 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
+------------------------+

- Stole documentation from `PyrogramMod <https://github.com/PyrogramMod/PyrogramMod>`_.
- Renamed ``send_reaction`` to :meth:`~pyrogram.Client.set_reaction`.
- **BREAKING CHANGES**: Renamed ``send_reaction`` to :meth:`~pyrogram.Client.set_reaction`.
- Added support for :meth:`~pyrogram.Client.send_photo`, :meth:`~pyrogram.Client.send_video`, :meth:`~pyrogram.Client.send_animation`, :meth:`~pyrogram.Client.send_voice` messages that could be played once.
- Added ``_raw`` to the :obj:`~pyrogram.types.Chat` object.
- Added the field ``via_chat_folder_invite_link`` to the class :obj:`~pyrogram.types.ChatMemberUpdated`.
- **BOTS ONLY**: Added updates about a reaction change on a message with non-anonymous reactions, represented by the class :obj:`~pyrogram.handlers.MessageReactionUpdatedHandler` and the field ``message_reaction`` in the class Update.
- **BOTS ONLY**: Added updates about reaction changes on a message with anonymous reactions, represented by the class :obj:`~pyrogram.handlers.MessageReactionCountUpdatedHandler` and the field ``message_reaction_count`` in the class Update.
Expand All @@ -240,9 +232,8 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt
- Added ``nosound_video`` parameter to :obj:`~pyrogram.types.InputMediaVideo`.
- Added ``has_spoiler`` parameter to :meth:`~pyrogram.Client.copy_message`.
- Improved :meth:`~pyrogram.Client.get_chat_history`: add ``min_id`` and ``max_id`` params.
- Improved ``set_reaction`` for Telegram Premium Users.
- `Prevent connection to dc every time in get_file <https://github.com/TelegramPlayGround/pyrogram/commit/f2581fd7ab84ada7685645a6f80475fbea5e743a>`_
- Added ``_raw`` to the :obj:`~pyrogram.types.Chat`, :obj:`~pyrogram.types.Dialog`, and :obj:`~pyrogram.types.User` objects.
- Added ``_raw`` to the :obj:`~pyrogram.types.Chat`, :obj:`~pyrogram.types.Dialog`, :obj:`~pyrogram.types.Message` and :obj:`~pyrogram.types.User` objects.
- Fix downloading media to ``WORKDIR`` when ``WORKDIR`` was not specified.
- `Update multiple fragment chat usernames <https://github.com/TelegramPlayGround/pyrogram/commit/39aea4831ee18e5263bf6755306f0ca49f075bda>`_
- `Custom Storage Engines <https://github.com/TelegramPlayGround/pyrogram/commit/cd937fff623759dcac8f437a8c524684868590a4>`_
Expand All @@ -254,12 +245,6 @@ If you found any issue or have any suggestions, feel free to make `an issue <htt

- Fixed the TL flags being Python reserved keywords: ``from`` and ``self``.

+------------------------+
| Scheme layer used: 164 |
+------------------------+

- Added ``_raw`` to the :obj:`~pyrogram.types.Message` object.

+------------------------+
| Scheme layer used: 161 |
+------------------------+
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

__fork_name__ = "pyrotgfork"
__version__ = "2.1.32.3"
__version__ = "2.1.32.4"
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"

Expand Down
4 changes: 1 addition & 3 deletions pyrogram/methods/messages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@
from .send_message import SendMessage
from .send_photo import SendPhoto
from .send_poll import SendPoll
from .set_reaction import (
SetReaction
)
from .set_reaction import SetReaction
from .send_sticker import SendSticker
from .send_venue import SendVenue
from .send_video import SendVideo
Expand Down
14 changes: 14 additions & 0 deletions pyrogram/methods/messages/send_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async def send_document(
"types.ForceReply"
] = None,
reply_to_message_id: int = None,
force_document: bool = None,
progress: Callable = None,
progress_args: tuple = ()
) -> Optional["types.Message"]:
Expand Down Expand Up @@ -183,6 +184,19 @@ async def progress(current, total):
)
reply_parameters = types.ReplyParameters(message_id=reply_to_message_id)

if force_document and disable_content_type_detection:
raise ValueError(
"Parameters `force_document` and `disable_content_type_detection` "
"are mutually exclusive."
)

if force_document is not None:
log.warning(
"This property is deprecated. "
"Please use disable_content_type_detection instead"
)
disable_content_type_detection = force_document

file = None

try:
Expand Down
19 changes: 18 additions & 1 deletion pyrogram/types/bots_and_keyboards/force_reply.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

import logging

import pyrogram
from pyrogram import raw

from ..object import Object

log = logging.getLogger(__name__)


class ForceReply(Object):
"""Object used to force clients to show a reply interface.
Expand All @@ -44,8 +48,21 @@ class ForceReply(Object):
def __init__(
self,
selective: bool = None,
input_field_placeholder: str = None
input_field_placeholder: str = None,
placeholder: str = None
):
if placeholder and input_field_placeholder:
raise ValueError(
"Parameters `placeholder` and `input_field_placeholder` are mutually exclusive."
)

if placeholder is not None:
log.warning(
"This property is deprecated. "
"Please use input_field_placeholder instead"
)
input_field_placeholder = placeholder

super().__init__()

self.selective = selective
Expand Down
21 changes: 18 additions & 3 deletions pyrogram/types/bots_and_keyboards/reply_keyboard_markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

import logging
from typing import List, Union

import pyrogram
from pyrogram import raw
from pyrogram import types
from pyrogram import raw, types
from ..object import Object

log = logging.getLogger(__name__)


class ReplyKeyboardMarkup(Object):
"""A custom keyboard with reply options.
Expand Down Expand Up @@ -63,8 +65,21 @@ def __init__(
resize_keyboard: bool = None,
one_time_keyboard: bool = None,
input_field_placeholder: str = None,
selective: bool = None
selective: bool = None,
placeholder: str = None,
):
if placeholder and input_field_placeholder:
raise ValueError(
"Parameters `placeholder` and `input_field_placeholder` are mutually exclusive."
)

if placeholder is not None:
log.warning(
"This property is deprecated. "
"Please use input_field_placeholder instead"
)
input_field_placeholder = placeholder

super().__init__()

self.keyboard = keyboard
Expand Down
2 changes: 2 additions & 0 deletions pyrogram/types/messages_and_media/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,7 @@ async def reply_document(
"types.ForceReply"
] = None,
reply_to_message_id: int = None,
force_document: bool = None,
progress: Callable = None,
progress_args: tuple = ()
) -> "Message":
Expand Down Expand Up @@ -2236,6 +2237,7 @@ async def reply_document(
protect_content=protect_content,
reply_markup=reply_markup,
reply_to_message_id=reply_to_message_id,
force_document=force_document,
progress=progress,
progress_args=progress_args
)
Expand Down

0 comments on commit 6141eed

Please sign in to comment.