Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Full Support for Bot API 8.1 #4594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 7, 2024
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
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:target: https://pypi.org/project/python-telegram-bot/
:alt: Supported Python versions

.. image:: https://img.shields.io/badge/Bot%20API-8.0-blue?logo=telegram
.. image:: https://img.shields.io/badge/Bot%20API-8.1-blue?logo=telegram
:target: https://core.telegram.org/bots/api-changelog
:alt: Supported Bot API version

Expand Down Expand Up @@ -81,7 +81,7 @@ After installing_ the library, be sure to check out the section on `working with
Telegram API support
~~~~~~~~~~~~~~~~~~~~

All types and methods of the Telegram Bot API **8.0** are natively supported by this library.
All types and methods of the Telegram Bot API **8.1** are natively supported by this library.
In addition, Bot API functionality not yet natively included can still be used as described `in our wiki <https://github.com/python-telegram-bot/python-telegram-bot/wiki/Bot-API-Forward-Compatibility>`_.

Notable Features
Expand Down
5 changes: 5 additions & 0 deletions docs/auxil/sphinx_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ def autodoc_process_bases(app, name, obj, option, bases: list) -> None:
bases[idx] = ":class:`enum.IntEnum`"
continue

if "FloatEnum" in base:
bases[idx] = ":class:`enum.Enum`"
bases.insert(0, ":class:`float`")
continue

# Drop generics (at least for now)
if base.endswith("]"):
base = base.split("[", maxsplit=1)[0]
Expand Down
6 changes: 6 additions & 0 deletions docs/source/telegram.affiliateinfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AffiliateInfo
=============

.. autoclass:: telegram.AffiliateInfo
:members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/source/telegram.constants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ telegram.constants Module
:members:
:show-inheritance:
:no-undoc-members:
:inherited-members: Enum, EnumMeta, str, int
:inherited-members: Enum, EnumMeta, str, int, float
:exclude-members: __format__, __new__, __repr__, __str__
2 changes: 2 additions & 0 deletions docs/source/telegram.payments-tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Your bot can accept payments from Telegram users. Please see the `introduction t
.. toctree::
:titlesonly:

telegram.affiliateinfo
telegram.invoice
telegram.labeledprice
telegram.orderinfo
Expand All @@ -25,6 +26,7 @@ Your bot can accept payments from Telegram users. Please see the `introduction t
telegram.startransactions
telegram.successfulpayment
telegram.transactionpartner
telegram.transactionpartneraffiliateprogram
telegram.transactionpartnerfragment
telegram.transactionpartnerother
telegram.transactionpartnertelegramads
Expand Down
6 changes: 6 additions & 0 deletions docs/source/telegram.transactionpartneraffiliateprogram.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TransactionPartnerAffiliateProgram
===================================

.. autoclass:: telegram.TransactionPartnerAffiliateProgram
:members:
:show-inheritance:
4 changes: 4 additions & 0 deletions telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

__author__ = "[email protected]"
__all__ = (
"AffiliateInfo",
"Animation",
"Audio",
"BackgroundFill",
Expand Down Expand Up @@ -236,6 +237,7 @@
"TelegramObject",
"TextQuote",
"TransactionPartner",
"TransactionPartnerAffiliateProgram",
"TransactionPartnerFragment",
"TransactionPartnerOther",
"TransactionPartnerTelegramAds",
Expand Down Expand Up @@ -469,13 +471,15 @@
from ._payment.shippingoption import ShippingOption
from ._payment.shippingquery import ShippingQuery
from ._payment.stars import (
AffiliateInfo,
RevenueWithdrawalState,
RevenueWithdrawalStateFailed,
RevenueWithdrawalStatePending,
RevenueWithdrawalStateSucceeded,
StarTransaction,
StarTransactions,
TransactionPartner,
TransactionPartnerAffiliateProgram,
TransactionPartnerFragment,
TransactionPartnerOther,
TransactionPartnerTelegramAds,
Expand Down
5 changes: 4 additions & 1 deletion telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8175,7 +8175,10 @@ async def create_invoice_link(
``“XTR”`` (Telegram Stars) if the parameter is used. Currently, it must always be
:tg-const:`telegram.constants.InvoiceLimit.SUBSCRIPTION_PERIOD` if specified. Any
number of subscriptions can be active for a given bot at the same time, including
multiple concurrent subscriptions from the same user.
multiple concurrent subscriptions from the same user. Subscription price must
not exceed
:tg-const:`telegram.constants.InvoiceLimit.SUBSCRIPTION_MAX_PRICE`
Telegram Stars.

.. versionadded:: 21.8
max_tip_amount (:obj:`int`, optional): The maximum accepted amount for tips in the
Expand Down
Loading
Loading