Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,47 @@
Changelog
=========

Version 21.10
=============

*Released 2025-01-03*

This is the technical changelog for version 21.10. More elaborate release notes can be found in the news channel `@pythontelegrambotchannel <https://t.me/pythontelegrambotchannel>`_.

Major Changes
-------------

- Full Support for Bot API 8.2 (:pr:`4633`)
- Bump ``apscheduler`` & Deprecate ``pytz`` Support (:pr:`4582`)

New Features
------------
- Add Parameter ``pattern`` to ``JobQueue.jobs()`` (:pr:`4613` closes :issue:`4544`)
- Allow Input of Type ``Sticker`` for Several Methods (:pr:`4616` closes :issue:`4580`)

Bug Fixes
---------
- Ensure Forward Compatibility of ``Gift`` and ``Gifts`` (:pr:`4634` closes :issue:`4637`)


Documentation Improvements & Internal Changes
---------------------------------------------

- Use Custom Labels for ``dependabot`` PRs (:pr:`4621`)
- Remove Redundant ``pylint`` Suppressions (:pr:`4628`)
- Update Copyright to 2025 (:pr:`4631`)
- Refactor Module Structure and Tests for Star Payments Classes (:pr:`4615` closes :issue:`4593`)
- Unify ``datetime`` Imports (:pr:`4605` by `cuevasrja <https://github.com/cuevasrja>`_ closes :issue:`4577`)
- Add Static Security Analysis of GitHub Actions Workflows (:pr:`4606`)

Dependency Updates
------------------

- Bump ``astral-sh/setup-uv`` from 4.2.0 to 5.1.0 (:pr:`4625`)
- Bump ``codecov/codecov-action`` from 5.1.1 to 5.1.2 (:pr:`4622`)
- Bump ``actions/upload-artifact`` from 4.4.3 to 4.5.0 (:pr:`4623`)
- Bump ``github/codeql-action`` from 3.27.9 to 3.28.0 (:pr:`4624`)

Version 21.9
============

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ PTB can be installed with optional dependencies:
* ``pip install "python-telegram-bot[rate-limiter]"`` installs `aiolimiter~=1.1,<1.3 <https://aiolimiter.readthedocs.io/en/stable/>`_. Use this, if you want to use ``telegram.ext.AIORateLimiter``.
* ``pip install "python-telegram-bot[webhooks]"`` installs the `tornado~=6.4 <https://www.tornadoweb.org/en/stable/>`_ library. Use this, if you want to use ``telegram.ext.Updater.start_webhook``/``telegram.ext.Application.run_webhook``.
* ``pip install "python-telegram-bot[callback-data]"`` installs the `cachetools>=5.3.3,<5.6.0 <https://cachetools.readthedocs.io/en/latest/>`_ library. Use this, if you want to use `arbitrary callback_data <https://github.com/python-telegram-bot/python-telegram-bot/wiki/Arbitrary-callback_data>`_.
* ``pip install "python-telegram-bot[job-queue]"`` installs the `APScheduler~=3.10.4 <https://apscheduler.readthedocs.io/en/3.x/>`_ library. Use this, if you want to use the ``telegram.ext.JobQueue``.
* ``pip install "python-telegram-bot[job-queue]"`` installs the `APScheduler>=3.10.4,<3.12.0 <https://apscheduler.readthedocs.io/en/3.x/>`_ library. Use this, if you want to use the ``telegram.ext.JobQueue``.

To install multiple optional dependencies, separate them by commas, e.g. ``pip install "python-telegram-bot[socks,webhooks]"``.

Expand Down
22 changes: 11 additions & 11 deletions telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -6637,7 +6637,7 @@ async def set_sticker_position_in_set(
sticker (:obj:`str` | :class:`~telegram.Sticker`): File identifier of the sticker or
the sticker object.

.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.10
Accepts also :class:`telegram.Sticker` instances.
position (:obj:`int`): New sticker position in the set, zero-based.

Expand Down Expand Up @@ -6770,7 +6770,7 @@ async def delete_sticker_from_set(
sticker (:obj:`str` | :class:`telegram.Sticker`): File identifier of the sticker or
the sticker object.

.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.10
Accepts also :class:`telegram.Sticker` instances.

Returns:
Expand Down Expand Up @@ -6967,7 +6967,7 @@ async def set_sticker_emoji_list(
sticker (:obj:`str` | :class:`~telegram.Sticker`): File identifier of the sticker or
the sticker object.

.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.10
Accepts also :class:`telegram.Sticker` instances.
emoji_list (Sequence[:obj:`str`]): A sequence of
:tg-const:`telegram.constants.StickerLimit.MIN_STICKER_EMOJI`-
Expand Down Expand Up @@ -7015,7 +7015,7 @@ async def set_sticker_keywords(
sticker (:obj:`str` | :class:`~telegram.Sticker`): File identifier of the sticker or
the sticker object.

.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.10
Accepts also :class:`telegram.Sticker` instances.
keywords (Sequence[:obj:`str`]): A sequence of
0-:tg-const:`telegram.constants.StickerLimit.MAX_SEARCH_KEYWORDS` search keywords
Expand Down Expand Up @@ -7063,7 +7063,7 @@ async def set_sticker_mask_position(
sticker (:obj:`str` | :class:`~telegram.Sticker`): File identifier of the sticker or
the sticker object.

.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.10
Accepts also :class:`telegram.Sticker` instances.
mask_position (:class:`telegram.MaskPosition`, optional): A object with the position
where the mask should be placed on faces. Omit the parameter to remove the mask
Expand Down Expand Up @@ -9301,7 +9301,7 @@ async def replace_sticker_in_set(
old_sticker (:obj:`str` | :class:`~telegram.Sticker`): File identifier of the replaced
sticker or the sticker object itself.

.. versionchanged:: NEXT.VERSION
.. versionchanged:: 21.10
Accepts also :class:`telegram.Sticker` instances.
sticker (:class:`telegram.InputSticker`): An object with information about the added
sticker. If exactly the same sticker had already been added to the set, then the
Expand Down Expand Up @@ -9756,7 +9756,7 @@ async def send_gift(
pay_for_upgrade (:obj:`bool`, optional): Pass :obj:`True` to pay for the gift upgrade
from the bot's balance, thereby making the upgrade free for the receiver.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Returns:
:obj:`bool`: On success, :obj:`True` is returned.
Expand Down Expand Up @@ -9795,7 +9795,7 @@ async def verify_chat(
) -> bool:
"""Verifies a chat on behalf of the organization which is represented by the bot.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Args:
chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
Expand Down Expand Up @@ -9837,7 +9837,7 @@ async def verify_user(
) -> bool:
"""Verifies a user on behalf of the organization which is represented by the bot.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Args:
user_id (:obj:`int`): Unique identifier of the target user.
Expand Down Expand Up @@ -9881,7 +9881,7 @@ async def remove_chat_verification(



.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Args:
chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
Expand Down Expand Up @@ -9920,7 +9920,7 @@ async def remove_user_verification(



.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Args:
user_id (:obj:`int`): Unique identifier of the target user.
Expand Down
4 changes: 2 additions & 2 deletions telegram/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3496,7 +3496,7 @@ async def verify(
For the documentation of the arguments, please see
:meth:`telegram.Bot.verify_chat`.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Returns:
:obj:`bool`: On success, :obj:`True` is returned.
Expand Down Expand Up @@ -3527,7 +3527,7 @@ async def remove_verification(
For the documentation of the arguments, please see
:meth:`telegram.Bot.remove_chat_verification`.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Returns:
:obj:`bool`: On success, :obj:`True` is returned.
Expand Down
4 changes: 2 additions & 2 deletions telegram/_gifts.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Gift(TelegramObject):
upgrade_star_count (:obj:`int`, optional): The number of Telegram Stars that must be paid
to upgrade the gift to a unique one

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Attributes:
id (:obj:`str`): Unique identifier of the gift
Expand All @@ -62,7 +62,7 @@ class Gift(TelegramObject):
upgrade_star_count (:obj:`int`): Optional. The number of Telegram Stars that must be paid
to upgrade the gift to a unique one

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

"""

Expand Down
6 changes: 3 additions & 3 deletions telegram/_inline/inlinequeryresultarticle.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class InlineQueryResultArticle(InlineQueryResult):
hide_url (:obj:`bool`, optional): Pass :obj:`True`, if you don't want the URL to be shown
in the message.

.. deprecated:: NEXT.VERSION
.. deprecated:: 21.10
This attribute will be removed in future PTB versions. Pass an empty string as URL
instead.
description (:obj:`str`, optional): Short description of the result.
Expand Down Expand Up @@ -81,7 +81,7 @@ class InlineQueryResultArticle(InlineQueryResult):
hide_url (:obj:`bool`): Optional. Pass :obj:`True`, if you don't want the URL to be shown
in the message.

.. deprecated:: NEXT.VERSION
.. deprecated:: 21.10
This attribute will be removed in future PTB versions. Pass an empty string as URL
instead.
description (:obj:`str`): Optional. Short description of the result.
Expand Down Expand Up @@ -136,7 +136,7 @@ def __init__(
if hide_url is not None:
warn(
PTBDeprecationWarning(
"NEXT.VERSION",
"21.10",
"The argument `hide_url` will be removed in future PTB"
"versions. Pass an empty string as URL instead.",
),
Expand Down
4 changes: 2 additions & 2 deletions telegram/_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ async def verify(
For the documentation of the arguments, please see
:meth:`telegram.Bot.verify_user`.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Returns:
:obj:`bool`: On success, :obj:`True` is returned.
Expand Down Expand Up @@ -2321,7 +2321,7 @@ async def remove_verification(
For the documentation of the arguments, please see
:meth:`telegram.Bot.remove_user_verification`.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Returns:
:obj:`bool`: On success, :obj:`True` is returned.
Expand Down
2 changes: 1 addition & 1 deletion telegram/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ def __str__(self) -> str:


__version_info__: Final[Version] = Version(
major=21, minor=9, micro=0, releaselevel="final", serial=0
major=21, minor=10, micro=0, releaselevel="final", serial=0
)
__version__: Final[str] = str(__version_info__)
2 changes: 1 addition & 1 deletion telegram/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3237,7 +3237,7 @@ class VerifyLimit(IntEnum):
:meth:`~telegram.Bot.verify_user`.
The enum members of this enumeration are instances of :class:`int` and can be treated as such.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10
"""

__slots__ = ()
Expand Down
4 changes: 2 additions & 2 deletions telegram/ext/_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Defaults:
somewhere, it will be assumed to be in :paramref:`tzinfo`. Defaults to
:attr:`datetime.timezone.utc` otherwise.

.. deprecated:: NEXT.VERSION
.. deprecated:: 21.10
Support for ``pytz`` timezones is deprecated and will be removed in future
versions.

Expand Down Expand Up @@ -155,7 +155,7 @@ def __init__(
# TODO: When dropping support, make sure to update _utils.datetime accordingly
warn(
message=PTBDeprecationWarning(
version="NEXT.VERSION",
version="21.10",
message=(
"Support for pytz timezones is deprecated and will be removed in "
"future versions."
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_jobqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ def jobs(self, pattern: Union[str, re.Pattern[str], None] = None) -> tuple["Job[
Hint:
This uses :func:`re.search` and not :func:`re.match`.

.. versionadded:: NEXT.VERSION
.. versionadded:: 21.10

Returns:
tuple[:class:`Job`]: Tuple of all *scheduled* jobs.
Expand Down