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

Skip to content

Full Support for Bot API 9.0 #4756

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

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
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.3-blue?logo=telegram
.. image:: https://img.shields.io/badge/Bot%20API-9.0-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.3** are natively supported by this library.
All types and methods of the Telegram Bot API **9.0** 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
42 changes: 42 additions & 0 deletions changes/unreleased/4756.JT5nmUmGRG6qDEh5ScMn5f.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
features = "Full Support for Bot API 9.0"
deprecations = """This release comes with several deprecations, in line with our :ref:`stability policy <stability-policy>`.
This includes the following:

- Deprecated ``telegram.constants.StarTransactionsLimit.NANOSTAR_MIN_AMOUNT`` and ``telegram.constants.StarTransactionsLimit.NANOSTAR_MAX_AMOUNT``. These members will be replaced by ``telegram.constants.NanostarLimit.MIN_AMOUNT`` and ``telegram.constants.NanostarLimit.MAX_AMOUNT``.
- Deprecated the class ``telegram.constants.StarTransactions``. Its only member ``telegram.constants.StarTransactions.NANOSTAR_VALUE`` will be replaced by ``telegram.constants.Nanostar.VALUE``.
- Bot API 9.0 deprecated ``BusinessConnection.can_reply`` in favor of ``BusinessConnection.rights``
- Bot API 9.0 deprecated ``ChatFullInfo.can_send_gift`` in favor of ``ChatFullInfo.accepted_gift_types``.

These deprecations are backward compatible, but we strongly recommend to update your code to use the new members.
"""
[[pull_requests]]
uid = "4756"
author_uid = "Bibo-Joshi"
closes_threads = ["4754"]
[[pull_requests]]
uid = "4757"
author_uid = "Bibo-Joshi"
closes_threads = []
[[pull_requests]]
uid = "4759"
author_uid = "Bibo-Joshi"
closes_threads = []
[[pull_requests]]
uid = "4763"
author_uid = "aelkheir"
closes_threads = []
[[pull_requests]]
uid = "4766"
author_uid = "Bibo-Joshi"
[[pull_requests]]
uid = "4769"
author_uid = "aelkheir"
closes_threads = []
[[pull_requests]]
uid = "4773"
author_uid = "aelkheir"
closes_threads = []
[[pull_requests]]
uid = "4782"
author_uid = "Bibo-Joshi"
closes_threads = []
54 changes: 52 additions & 2 deletions docs/source/inclusions/bot_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@
- Used for unpinning a message
* - :meth:`~telegram.Bot.unpin_all_chat_messages`
- Used for unpinning all pinned chat messages
* - :meth:`~telegram.Bot.get_business_connection`
- Used for getting information about the business account.
* - :meth:`~telegram.Bot.get_user_profile_photos`
- Used for obtaining user's profile pictures
* - :meth:`~telegram.Bot.get_chat`
Expand Down Expand Up @@ -397,6 +395,58 @@
* - :meth:`~telegram.Bot.refund_star_payment`
- Used for refunding a payment in Telegram Stars

.. raw:: html

</details>
<br>

.. raw:: html

<details>
<summary>Business Related Methods</summary>

.. list-table::
:align: left
:widths: 1 4

* - :meth:`~telegram.Bot.get_business_connection`
- Used for getting information about the business account.
* - :meth:`~telegram.Bot.get_business_account_gifts`
- Used for getting gifts owned by the business account.
* - :meth:`~telegram.Bot.get_business_account_star_balance`
- Used for getting the amount of Stars owned by the business account.
* - :meth:`~telegram.Bot.read_business_message`
- Used for marking a message as read.
* - :meth:`~telegram.Bot.delete_story`
- Used for deleting business stories posted by the bot.
* - :meth:`~telegram.Bot.delete_business_messages`
- Used for deleting business messages.
* - :meth:`~telegram.Bot.remove_business_account_profile_photo`
- Used for removing the business accounts profile photo
* - :meth:`~telegram.Bot.set_business_account_name`
- Used for setting the business account name.
* - :meth:`~telegram.Bot.set_business_account_username`
- Used for setting the business account username.
* - :meth:`~telegram.Bot.set_business_account_bio`
- Used for setting the business account bio.
* - :meth:`~telegram.Bot.set_business_account_gift_settings`
- Used for setting the business account gift settings.
* - :meth:`~telegram.Bot.set_business_account_profile_photo`
- Used for setting the business accounts profile photo
* - :meth:`~telegram.Bot.post_story`
- Used for posting a story on behalf of business account.
* - :meth:`~telegram.Bot.edit_story`
- Used for editing business stories posted by the bot.
* - :meth:`~telegram.Bot.convert_gift_to_stars`
- Used for converting owned reqular gifts to stars.
* - :meth:`~telegram.Bot.upgrade_gift`
- Used for upgrading owned regular gifts to unique ones.
* - :meth:`~telegram.Bot.transfer_gift`
- Used for transferring owned unique gifts to another user.
* - :meth:`~telegram.Bot.transfer_business_account_stars`
- Used for transfering Stars from the business account balance to the bot's balance.


.. raw:: html

</details>
Expand Down
6 changes: 6 additions & 0 deletions docs/source/telegram.acceptedgifttypes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
AcceptedGiftTypes
=================

.. autoclass:: telegram.AcceptedGiftTypes
:members:
:show-inheritance:
29 changes: 29 additions & 0 deletions docs/source/telegram.at-tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Available Types
.. toctree::
:titlesonly:

telegram.acceptedgifttypes
telegram.animation
telegram.audio
telegram.birthdate
Expand All @@ -19,6 +20,7 @@ Available Types
telegram.botdescription
telegram.botname
telegram.botshortdescription
telegram.businessbotrights
telegram.businessconnection
telegram.businessintro
telegram.businesslocation
Expand Down Expand Up @@ -75,6 +77,7 @@ Available Types
telegram.forumtopicreopened
telegram.generalforumtopichidden
telegram.generalforumtopicunhidden
telegram.giftinfo
telegram.giveaway
telegram.giveawaycompleted
telegram.giveawaycreated
Expand All @@ -92,13 +95,20 @@ Available Types
telegram.inputpaidmedia
telegram.inputpaidmediaphoto
telegram.inputpaidmediavideo
telegram.inputprofilephoto
telegram.inputprofilephotoanimated
telegram.inputprofilephotostatic
telegram.inputpolloption
telegram.inputstorycontent
telegram.inputstorycontentphoto
telegram.inputstorycontentvideo
telegram.keyboardbutton
telegram.keyboardbuttonpolltype
telegram.keyboardbuttonrequestchat
telegram.keyboardbuttonrequestusers
telegram.linkpreviewoptions
telegram.location
telegram.locationaddress
telegram.loginurl
telegram.maybeinaccessiblemessage
telegram.menubutton
Expand All @@ -116,12 +126,17 @@ Available Types
telegram.messageoriginuser
telegram.messagereactioncountupdated
telegram.messagereactionupdated
telegram.ownedgift
telegram.ownedgiftregular
telegram.ownedgifts
telegram.ownedgiftunique
telegram.paidmedia
telegram.paidmediainfo
telegram.paidmediaphoto
telegram.paidmediapreview
telegram.paidmediapurchased
telegram.paidmediavideo
telegram.paidmessagepricechanged
telegram.photosize
telegram.poll
telegram.pollanswer
Expand All @@ -138,9 +153,23 @@ Available Types
telegram.sentwebappmessage
telegram.shareduser
telegram.story
telegram.storyarea
telegram.storyareaposition
telegram.storyareatype
telegram.storyareatypelink
telegram.storyareatypelocation
telegram.storyareatypesuggestedreaction
telegram.storyareatypeuniquegift
telegram.storyareatypeweather
telegram.switchinlinequerychosenchat
telegram.telegramobject
telegram.textquote
telegram.uniquegift
telegram.uniquegiftbackdrop
telegram.uniquegiftbackdropcolors
telegram.uniquegiftinfo
telegram.uniquegiftmodel
telegram.uniquegiftsymbol
telegram.update
telegram.user
telegram.userchatboosts
Expand Down
6 changes: 6 additions & 0 deletions docs/source/telegram.businessbotrights.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BusinessBotRights
=================

.. autoclass:: telegram.BusinessBotRights
:members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/telegram.giftinfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
GiftInfo
========

.. autoclass:: telegram.GiftInfo
:members:
:show-inheritance:

6 changes: 6 additions & 0 deletions docs/source/telegram.inputprofilephoto.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
InputProfilePhoto
=================

.. autoclass:: telegram.InputProfilePhoto
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.inputprofilephotoanimated.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
InputProfilePhotoAnimated
=========================

.. autoclass:: telegram.InputProfilePhotoAnimated
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.inputprofilephotostatic.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
InputProfilePhotoStatic
=======================

.. autoclass:: telegram.InputProfilePhotoStatic
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.inputstorycontent.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
InputStoryContent
=================

.. autoclass:: telegram.InputStoryContent
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.inputstorycontentphoto.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
InputStoryContentPhoto
======================

.. autoclass:: telegram.InputStoryContentPhoto
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.inputstorycontentvideo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
InputStoryContentVideo
======================

.. autoclass:: telegram.InputStoryContentVideo
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.locationaddress.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
LocationAddress
===============

.. autoclass:: telegram.LocationAddress
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgift.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGift
=========

.. autoclass:: telegram.OwnedGift
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgiftregular.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGiftRegular
================

.. autoclass:: telegram.OwnedGiftRegular
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgifts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGifts
==========

.. autoclass:: telegram.OwnedGifts
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.ownedgiftunique.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OwnedGiftUnique
===============

.. autoclass:: telegram.OwnedGiftUnique
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.paidmeessagepricechanged.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PaidMessagePriceChanged
=======================

.. autoclass:: telegram.PaidMessagePriceChanged
:members:
:show-inheritance:
1 change: 1 addition & 0 deletions docs/source/telegram.payments-tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Your bot can accept payments from Telegram users. Please see the `introduction t
telegram.shippingaddress
telegram.shippingoption
telegram.shippingquery
telegram.staramount
telegram.startransaction
telegram.startransactions
telegram.successfulpayment
Expand Down
6 changes: 6 additions & 0 deletions docs/source/telegram.staramount.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StarAmount
==========

.. autoclass:: telegram.StarAmount
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyarea.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryArea
=========

.. autoclass:: telegram.StoryArea
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyareaposition.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryAreaPosition
=================

.. autoclass:: telegram.StoryAreaPosition
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyareatype.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryAreaType
=============

.. autoclass:: telegram.StoryAreaType
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyareatypelink.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryAreaTypeLink
=================

.. autoclass:: telegram.StoryAreaTypeLink
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyareatypelocation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryAreaTypeLocation
=====================

.. autoclass:: telegram.StoryAreaTypeLocation
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyareatypesuggestedreaction.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryAreaTypeSuggestedReaction
==============================

.. autoclass:: telegram.StoryAreaTypeSuggestedReaction
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyareatypeuniquegift.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryAreaTypeUniqueGift
=======================

.. autoclass:: telegram.StoryAreaTypeUniqueGift
:members:
:show-inheritance:
6 changes: 6 additions & 0 deletions docs/source/telegram.storyareatypeweather.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StoryAreaTypeWeather
====================

.. autoclass:: telegram.StoryAreaTypeWeather
:members:
:show-inheritance:
Loading
Loading