Skip to content
Merged

API 6.0 #2956

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0bf01fe
Added (Sent)WebApp{Data, Info, Message} and tests
harshil21 Apr 17, 2022
cde96b9
deepsource + test fix
harshil21 Apr 17, 2022
28d0ee7
A bunch of renamings
Bibo-Joshi Apr 24, 2022
c3fcc5c
MenuButton* classes - no tests yet
Bibo-Joshi Apr 25, 2022
db75de7
tests for MenuButton*
Bibo-Joshi Apr 26, 2022
bc7f919
add missing slots
Bibo-Joshi Apr 26, 2022
be6111c
review
harshil21 Apr 26, 2022
e444400
set/getchatmenubutton - not tests yet
Bibo-Joshi Apr 26, 2022
03cea71
Merge remote-tracking branch 'origin/api-6.0' into api-6.0
Bibo-Joshi Apr 26, 2022
54a6a48
Add ChatAdminRights and its methods + tests
harshil21 Apr 26, 2022
de32bc1
v14 -> v20 for these new classes and methods
harshil21 Apr 26, 2022
4554f5a
Merge branch 'api-6.0' of https://github.com/python-telegram-bot/pyth…
harshil21 Apr 26, 2022
0d88c1c
add new param to webhookinfo
harshil21 Apr 26, 2022
3429c2a
Fix docs and add menu methods to bot_methods.rst
harshil21 Apr 26, 2022
3a4285b
add de_json for WebhookInfo + adjust its test
harshil21 Apr 26, 2022
b468a7d
add missing camelcase chatadminrights methods
harshil21 Apr 26, 2022
6801613
Add filters.StatusUpdate.WEB_APP_DATA + test
harshil21 Apr 26, 2022
86e8431
bump api version number
harshil21 Apr 26, 2022
061ccb6
add tests for menu methods
harshil21 Apr 26, 2022
094f3db
add missing versionadded in webappmenu
harshil21 Apr 26, 2022
93aecfb
Fix test_offical + pre-commit
harshil21 Apr 26, 2022
ee539c7
review
Bibo-Joshi Apr 27, 2022
517fe2b
where -> were
harshil21 Apr 27, 2022
e59b1d5
review
Bibo-Joshi Apr 27, 2022
d06c735
merge v14 and fix conflict
harshil21 May 1, 2022
eff4cc2
Merge branch 'v14' into api-6.0
Bibo-Joshi May 3, 2022
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 @@ -20,7 +20,7 @@ We have a vibrant community of developers helping each other in our `Telegram gr
:target: https://pypi.org/project/python-telegram-bot/
:alt: Supported Python versions

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

Expand Down Expand Up @@ -111,7 +111,7 @@ Installing both ``python-telegram-bot`` and ``python-telegram-bot-raw`` in conju
Telegram API support
====================

All types and methods of the Telegram Bot API **5.7** are supported.
All types and methods of the Telegram Bot API **6.0** are supported.

===========
Concurrency
Expand Down
4 changes: 2 additions & 2 deletions README_RAW.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ We have a vibrant community of developers helping each other in our `Telegram gr
:target: https://pypi.org/project/python-telegram-bot-raw/
:alt: Supported Python versions

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

Expand Down Expand Up @@ -105,7 +105,7 @@ Installing both ``python-telegram-bot`` and ``python-telegram-bot-raw`` in conju
Telegram API support
====================

All types and methods of the Telegram Bot API **5.7** are supported.
All types and methods of the Telegram Bot API **6.0** are supported.

===========
Concurrency
Expand Down
10 changes: 10 additions & 0 deletions docs/source/bot_methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
- Used for answering a pre checkout query
* - :meth:`~telegram.Bot.answer_shipping_query`
- Used for answering a shipping query
* - :meth:`~telegram.Bot.answer_web_app_query`
- Used for answering a web app query
* - :meth:`~telegram.Bot.edit_message_caption`
- Used for editing captions
* - :meth:`~telegram.Bot.edit_message_media`
Expand Down Expand Up @@ -161,6 +163,14 @@
- Used for deleting the list of commands
* - :meth:`~telegram.Bot.get_my_commands`
- Used for obtaining the list of commands
* - :meth:`~telegram.Bot.get_my_default_administrator_rights`
- Used for obtaining the default administrator rights for the bot
* - :meth:`~telegram.Bot.set_my_default_administrator_rights`
- Used for setting the default administrator rights for the bot
* - :meth:`~telegram.Bot.get_chat_menu_button`
- Used for obtaining the menu button of a private chat or the default menu button
* - :meth:`~telegram.Bot.set_chat_menu_button`
- Used for setting the menu button of a private chat or the default menu button
* - :meth:`~telegram.Bot.leave_chat`
- Used for leaving a chat

Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ def process_link(self, env: BuildEnvironment, refnode: Element,
if isinstance(value, telegram.constants.FileSizeLimit):
return f'{int(value.value / 1e6)} MB', target
return repr(value.value), target
# Just for Bot API version number auto add in constants:
if isinstance(value, str) and target == 'telegram.constants.BOT_API_VERSION':
return value, target
sphinx_logger.warning(
f'%s:%d: WARNING: Did not convert reference %s. :{CONSTANTS_ROLE}: is not supposed'
' to be used with this type of target.',
Expand Down
8 changes: 8 additions & 0 deletions docs/source/telegram.chatadministratorrights.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
telegram.ChatAdministratorRights
================================

.. versionadded:: 20.0

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

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

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

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

.. autoclass:: telegram.MenuButtonWebApp
:members:
:show-inheritance:
16 changes: 12 additions & 4 deletions docs/source/telegram.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ telegram package
telegram.botcommandscopechatmember
telegram.callbackquery
telegram.chat
telegram.chatadministratorrights
telegram.chatinvitelink
telegram.chatjoinrequest
telegram.chatlocation
Expand Down Expand Up @@ -48,6 +49,10 @@ telegram package
telegram.keyboardbuttonpolltype
telegram.location
telegram.loginurl
telegram.menubutton
telegram.menubuttoncommands
telegram.menubuttondefault
telegram.menubuttonwebapp
telegram.message
telegram.messageautodeletetimerchanged
telegram.messageid
Expand All @@ -59,18 +64,21 @@ telegram package
telegram.proximityalerttriggered
telegram.replykeyboardremove
telegram.replykeyboardmarkup
telegram.sentwebappmessage
telegram.telegramobject
telegram.update
telegram.user
telegram.userprofilephotos
telegram.venue
telegram.video
telegram.videochatended
telegram.videochatparticipantsinvited
telegram.videochatscheduled
telegram.videochatstarted
telegram.videonote
telegram.voice
telegram.voicechatstarted
telegram.voicechatended
telegram.voicechatscheduled
telegram.voicechatparticipantsinvited
telegram.webappdata
telegram.webappinfo
telegram.webhookinfo

Stickers
Expand Down
6 changes: 6 additions & 0 deletions docs/source/telegram.sentwebappmessage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
telegram.SentWebAppMessage
===============================

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

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

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

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

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

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

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

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

9 changes: 0 additions & 9 deletions docs/source/telegram.voicechatended.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/source/telegram.voicechatparticipantsinvited.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/source/telegram.voicechatscheduled.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/source/telegram.voicechatstarted.rst

This file was deleted.

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

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

.. autoclass:: telegram.WebAppInfo
:members:
:show-inheritance:
35 changes: 24 additions & 11 deletions telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'CallbackGame',
'CallbackQuery',
'Chat',
'ChatAdministratorRights',
'ChatInviteLink',
'ChatJoinRequest',
'ChatLocation',
Expand Down Expand Up @@ -111,6 +112,10 @@
'Location',
'LoginUrl',
'MaskPosition',
'MenuButton',
'MenuButtonCommands',
'MenuButtonDefault',
'MenuButtonWebApp',
'Message',
'MessageAutoDeleteTimerChanged',
'MessageEntity',
Expand Down Expand Up @@ -141,6 +146,7 @@
'ResidentialAddress',
'SecureData',
'SecureValue',
'SentWebAppMessage',
'ShippingAddress',
'ShippingOption',
'ShippingQuery',
Expand All @@ -153,22 +159,31 @@
'UserProfilePhotos',
'Venue',
'Video',
'VideoChatEnded',
'VideoChatParticipantsInvited',
'VideoChatScheduled',
'VideoChatStarted',
'VideoNote',
'Voice',
'VoiceChatStarted',
'VoiceChatEnded',
'VoiceChatScheduled',
'VoiceChatParticipantsInvited',
'warnings',
'WebAppData',
'WebAppInfo',
'WebhookInfo',
)


from ._telegramobject import TelegramObject
from ._botcommand import BotCommand
from ._webappdata import WebAppData
from ._webappinfo import WebAppInfo
from ._sentwebappmessage import SentWebAppMessage
from ._menubutton import MenuButton, MenuButtonCommands, MenuButtonDefault, MenuButtonWebApp
from ._loginurl import LoginUrl
from ._games.callbackgame import CallbackGame
from ._user import User
from ._files.chatphoto import ChatPhoto
from ._chat import Chat
from ._chatadministratorrights import ChatAdministratorRights
from ._chatlocation import ChatLocation
from ._chatinvitelink import ChatInviteLink
from ._chatjoinrequest import ChatJoinRequest
Expand Down Expand Up @@ -207,15 +222,13 @@
from ._messageid import MessageId
from ._games.game import Game
from ._poll import Poll, PollOption, PollAnswer
from ._voicechat import (
VoiceChatStarted,
VoiceChatEnded,
VoiceChatParticipantsInvited,
VoiceChatScheduled,
from ._videochat import (
VideoChatStarted,
VideoChatEnded,
VideoChatParticipantsInvited,
VideoChatScheduled,
)
from ._loginurl import LoginUrl
from ._proximityalerttriggered import ProximityAlertTriggered
from ._games.callbackgame import CallbackGame
from ._payment.shippingaddress import ShippingAddress
from ._payment.orderinfo import OrderInfo
from ._payment.successfulpayment import SuccessfulPayment
Expand Down
Loading