Skip to content

Commit 7d893fd

Browse files
Bibo-JoshiPoolitzerharshil21
authored
* Improve some badges for PTB-Raw * doc fix for add_error_handler * Some rendering * Bump sphinx dependency * Change signature annotation setting * fix: chat_id can be string, message_id only int * feat: add RTD link to documentation * improving sender chat docstring (python-telegram-bot#2412) * fix: improving sender chat docstring also adding a note to a weird edge case * fix: words being hard * Add note on donations * typo * typo in User.get_profile_pictures docstrings * Fix: meth, not attr for meth, not attr * filters + inlinequery doc fix * Bump versions, update RTD config file * Try fix build * Revert "fix: chat_id can be string, message_id only int" This reverts commit ba04e5a * Add Starry & Harshil to credits Co-authored-by: poolitzer <[email protected]> Co-authored-by: Harshil <[email protected]>
1 parent 7015f8d commit 7d893fd

11 files changed

Lines changed: 136 additions & 97 deletions

File tree

.github/CONTRIBUTING.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Instructions for making a code change
5050

5151
The central development branch is ``master``, which should be clean and ready for release at any time. In general, all changes should be done as feature branches based off of ``master``.
5252

53+
If you want to do solely documentation changes, base them and PR to the branch ``doc-fixes``. This branch also has its own `RTD build`_.
54+
5355
Here's how to make a one-off code change.
5456

5557
1. **Choose a descriptive branch name.** It should be lowercase, hyphen-separated, and a noun describing the change (so, ``fuzzy-rules``, but not ``implement-fuzzy-rules``). Also, it shouldn't start with ``hotfix`` or ``release``.
@@ -250,3 +252,4 @@ break the API classes. For example:
250252
.. _`here`: https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html
251253
.. _`Black`: https://black.readthedocs.io/en/stable/index.html
252254
.. _`popular editors`: https://black.readthedocs.io/en/stable/editor_integration.html
255+
.. _`RTD build`: https://python-telegram-bot.readthedocs.io/en/doc-fixes

.readthedocs.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
# syntax: https://docs.readthedocs.io/en/latest/yaml-config.html
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
24

5+
# Required
6+
version: 2
7+
8+
# Build documentation in the docs/ directory with Sphinx
9+
sphinx:
10+
configuration: docs/source/conf.py
11+
12+
# Optionally build your docs in additional formats such as PDF
313
formats:
4-
- pdf
14+
- pdf
515

16+
# Optionally set the version of Python and requirements required to build your docs
617
python:
7-
setup_py_install: true
818
version: 3
9-
10-
requirements_file: docs/requirements-docs.txt
19+
install:
20+
- method: pip
21+
path: .
22+
- requirements: docs/requirements-docs.txt

AUTHORS.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ Credits
22
=======
33

44
``python-telegram-bot`` was originally created by
5-
`Leandro Toledo <https://github.com/leandrotoledo>`_ and is now maintained by `Hinrich Mahler <https://github.com/Bibo-Joshi>`_.
5+
`Leandro Toledo <https://github.com/leandrotoledo>`_.
6+
The current development team includes
7+
8+
- `Hinrich Mahler <https://github.com/Bibo-Joshi>`_ (maintainer)
9+
- `Poolitzer <https://github.com/Poolitzer>`_ (community liaison)
10+
- `Shivam <https://github.com/Starry69>`_
11+
- `Harshil <https://github.com/harshil21>`_
12+
613
Emeritus maintainers include
714
`Jannes Höke <https://github.com/jh0ker>`_ (`@jh0ker <https://t.me/jh0ker>`_ on Telegram),
815
`Noam Meltzer <https://github.com/tsnoam>`_, `Pieter Schutz <https://github.com/eldinnie>`_ and `Jasmin Bom <https://github.com/jsmnbom>`_.
916

10-
The maintainers are actively supported by `Poolitzer <https://github.com/Poolitzer>`_ in terms of development and community liaison.
17+
Vendored packages
18+
-----------------
1119

1220
We're vendoring urllib3 as part of ``python-telegram-bot`` which is distributed under the MIT
1321
license. For more info, full credits & license terms, the sources can be found here:

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ Contributing
230230

231231
Contributions of all sizes are welcome. Please review our `contribution guidelines <https://github.com/python-telegram-bot/python-telegram-bot/blob/master/.github/CONTRIBUTING.rst>`_ to get started. You can also help by `reporting bugs <https://github.com/python-telegram-bot/python-telegram-bot/issues/new>`_.
232232

233+
========
234+
Donating
235+
========
236+
Occasionally we are asked if we accept donations to support the development. While we appreciate the thought, maintaining PTB is our hobby and we have almost no running costs for it. We therefore have nothing set up to accept donations. If you still want to donate, we kindly ask you to donate to another open source project/initiative of your choice instead.
237+
233238
=======
234239
License
235240
=======

README_RAW.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ Contributing
212212

213213
Contributions of all sizes are welcome. Please review our `contribution guidelines <https://github.com/python-telegram-bot/python-telegram-bot/blob/master/.github/CONTRIBUTING.rst>`_ to get started. You can also help by `reporting bugs <https://github.com/python-telegram-bot/python-telegram-bot/issues/new>`_.
214214

215+
========
216+
Donating
217+
========
218+
Occasionally we are asked if we accept donations to support the development. While we appreciate the thought, maintaining PTB is our hobby and we have almost no running costs for it. We therefore have nothing set up to accept donations. If you still want to donate, we kindly ask you to donate to another open source project/initiative of your choice instead.
219+
215220
=======
216221
License
217222
=======

docs/requirements-docs.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
sphinx>=1.7.9
2-
sphinx_rtd_theme
1+
sphinx==3.5.2
2+
sphinx_rtd_theme==0.5.1
33
sphinx-pypi-upload

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# -- General configuration ------------------------------------------------
2525

2626
# If your documentation needs a minimal Sphinx version, state it here.
27-
needs_sphinx = '1.7.9'
27+
needs_sphinx = '3.5.2'
2828

2929
# Add any Sphinx extension module names here, as strings. They can be
3030
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -35,7 +35,7 @@
3535
]
3636
# Don't show type hints in the signature - that just makes it hardly readable
3737
# and we document the types anyway
38-
autodoc_typehints = 'description'
38+
autodoc_typehints = 'none'
3939

4040
# Add any paths that contain templates here, relative to this directory.
4141
templates_path = ['_templates']

telegram/bot.py

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ def edit_message_live_location(
15741574
) -> Union[Message, bool]:
15751575
"""Use this method to edit live location messages sent by the bot or via the bot
15761576
(for inline bots). A location can be edited until its :attr:`live_period` expires or
1577-
editing is explicitly disabled by a call to :attr:`stop_message_live_location`.
1577+
editing is explicitly disabled by a call to :meth:`stop_message_live_location`.
15781578
15791579
Note:
15801580
You can either supply a :obj:`latitude` and :obj:`longitude` or a :obj:`location`.
@@ -2200,7 +2200,7 @@ def get_file(
22002200
"""
22012201
Use this method to get basic info about a file and prepare it for downloading. For the
22022202
moment, bots can download files of up to 20MB in size. The file can then be downloaded
2203-
with :attr:`telegram.File.download`. It is guaranteed that the link will be
2203+
with :meth:`telegram.File.download`. It is guaranteed that the link will be
22042204
valid for at least 1 hour. When the link expires, a new one can be requested by
22052205
calling get_file again.
22062206
@@ -3074,7 +3074,7 @@ def set_chat_sticker_set(
30743074
"""Use this method to set a new group sticker set for a supergroup.
30753075
The bot must be an administrator in the chat for this to work and must have the appropriate
30763076
admin rights. Use the field :attr:`telegram.Chat.can_set_sticker_set` optionally returned
3077-
in :attr:`get_chat` requests to check if the bot can use this method.
3077+
in :meth:`get_chat` requests to check if the bot can use this method.
30783078
30793079
Args:
30803080
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
@@ -3106,7 +3106,7 @@ def delete_chat_sticker_set(
31063106
"""Use this method to delete a group sticker set from a supergroup. The bot must be an
31073107
administrator in the chat for this to work and must have the appropriate admin rights.
31083108
Use the field :attr:`telegram.Chat.can_set_sticker_set` optionally returned in
3109-
:attr:`get_chat` requests to check if the bot can use this method.
3109+
:meth:`get_chat` requests to check if the bot can use this method.
31103110
31113111
Args:
31123112
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
@@ -3541,7 +3541,7 @@ def restrict_chat_member(
35413541
:obj:`True` for all boolean parameters to lift restrictions from a user.
35423542
35433543
Note:
3544-
Since Bot API 4.4, :attr:`restrict_chat_member` takes the new user permissions in a
3544+
Since Bot API 4.4, :meth:`restrict_chat_member` takes the new user permissions in a
35453545
single argument of type :class:`telegram.ChatPermissions`. The old way of passing
35463546
parameters will not keep working forever.
35473547
@@ -4261,7 +4261,7 @@ def upload_sticker_file(
42614261
) -> File:
42624262
"""
42634263
Use this method to upload a .png file with a sticker for later use in
4264-
:attr:`create_new_sticker_set` and :attr:`add_sticker_to_set` methods (can be used multiple
4264+
:meth:`create_new_sticker_set` and :meth:`add_sticker_to_set` methods (can be used multiple
42654265
times).
42664266
42674267
Note:
@@ -5061,154 +5061,154 @@ def __hash__(self) -> int:
50615061

50625062
# camelCase aliases
50635063
getMe = get_me
5064-
"""Alias for :attr:`get_me`"""
5064+
"""Alias for :meth:`get_me`"""
50655065
sendMessage = send_message
5066-
"""Alias for :attr:`send_message`"""
5066+
"""Alias for :meth:`send_message`"""
50675067
deleteMessage = delete_message
5068-
"""Alias for :attr:`delete_message`"""
5068+
"""Alias for :meth:`delete_message`"""
50695069
forwardMessage = forward_message
5070-
"""Alias for :attr:`forward_message`"""
5070+
"""Alias for :meth:`forward_message`"""
50715071
sendPhoto = send_photo
5072-
"""Alias for :attr:`send_photo`"""
5072+
"""Alias for :meth:`send_photo`"""
50735073
sendAudio = send_audio
5074-
"""Alias for :attr:`send_audio`"""
5074+
"""Alias for :meth:`send_audio`"""
50755075
sendDocument = send_document
5076-
"""Alias for :attr:`send_document`"""
5076+
"""Alias for :meth:`send_document`"""
50775077
sendSticker = send_sticker
5078-
"""Alias for :attr:`send_sticker`"""
5078+
"""Alias for :meth:`send_sticker`"""
50795079
sendVideo = send_video
5080-
"""Alias for :attr:`send_video`"""
5080+
"""Alias for :meth:`send_video`"""
50815081
sendAnimation = send_animation
5082-
"""Alias for :attr:`send_animation`"""
5082+
"""Alias for :meth:`send_animation`"""
50835083
sendVoice = send_voice
5084-
"""Alias for :attr:`send_voice`"""
5084+
"""Alias for :meth:`send_voice`"""
50855085
sendVideoNote = send_video_note
5086-
"""Alias for :attr:`send_video_note`"""
5086+
"""Alias for :meth:`send_video_note`"""
50875087
sendMediaGroup = send_media_group
5088-
"""Alias for :attr:`send_media_group`"""
5088+
"""Alias for :meth:`send_media_group`"""
50895089
sendLocation = send_location
5090-
"""Alias for :attr:`send_location`"""
5090+
"""Alias for :meth:`send_location`"""
50915091
editMessageLiveLocation = edit_message_live_location
5092-
"""Alias for :attr:`edit_message_live_location`"""
5092+
"""Alias for :meth:`edit_message_live_location`"""
50935093
stopMessageLiveLocation = stop_message_live_location
5094-
"""Alias for :attr:`stop_message_live_location`"""
5094+
"""Alias for :meth:`stop_message_live_location`"""
50955095
sendVenue = send_venue
5096-
"""Alias for :attr:`send_venue`"""
5096+
"""Alias for :meth:`send_venue`"""
50975097
sendContact = send_contact
5098-
"""Alias for :attr:`send_contact`"""
5098+
"""Alias for :meth:`send_contact`"""
50995099
sendGame = send_game
5100-
"""Alias for :attr:`send_game`"""
5100+
"""Alias for :meth:`send_game`"""
51015101
sendChatAction = send_chat_action
5102-
"""Alias for :attr:`send_chat_action`"""
5102+
"""Alias for :meth:`send_chat_action`"""
51035103
answerInlineQuery = answer_inline_query
5104-
"""Alias for :attr:`answer_inline_query`"""
5104+
"""Alias for :meth:`answer_inline_query`"""
51055105
getUserProfilePhotos = get_user_profile_photos
5106-
"""Alias for :attr:`get_user_profile_photos`"""
5106+
"""Alias for :meth:`get_user_profile_photos`"""
51075107
getFile = get_file
5108-
"""Alias for :attr:`get_file`"""
5108+
"""Alias for :meth:`get_file`"""
51095109
kickChatMember = kick_chat_member
5110-
"""Alias for :attr:`kick_chat_member`"""
5110+
"""Alias for :meth:`kick_chat_member`"""
51115111
unbanChatMember = unban_chat_member
5112-
"""Alias for :attr:`unban_chat_member`"""
5112+
"""Alias for :meth:`unban_chat_member`"""
51135113
answerCallbackQuery = answer_callback_query
5114-
"""Alias for :attr:`answer_callback_query`"""
5114+
"""Alias for :meth:`answer_callback_query`"""
51155115
editMessageText = edit_message_text
5116-
"""Alias for :attr:`edit_message_text`"""
5116+
"""Alias for :meth:`edit_message_text`"""
51175117
editMessageCaption = edit_message_caption
5118-
"""Alias for :attr:`edit_message_caption`"""
5118+
"""Alias for :meth:`edit_message_caption`"""
51195119
editMessageMedia = edit_message_media
5120-
"""Alias for :attr:`edit_message_media`"""
5120+
"""Alias for :meth:`edit_message_media`"""
51215121
editMessageReplyMarkup = edit_message_reply_markup
5122-
"""Alias for :attr:`edit_message_reply_markup`"""
5122+
"""Alias for :meth:`edit_message_reply_markup`"""
51235123
getUpdates = get_updates
5124-
"""Alias for :attr:`get_updates`"""
5124+
"""Alias for :meth:`get_updates`"""
51255125
setWebhook = set_webhook
5126-
"""Alias for :attr:`set_webhook`"""
5126+
"""Alias for :meth:`set_webhook`"""
51275127
deleteWebhook = delete_webhook
5128-
"""Alias for :attr:`delete_webhook`"""
5128+
"""Alias for :meth:`delete_webhook`"""
51295129
leaveChat = leave_chat
5130-
"""Alias for :attr:`leave_chat`"""
5130+
"""Alias for :meth:`leave_chat`"""
51315131
getChat = get_chat
5132-
"""Alias for :attr:`get_chat`"""
5132+
"""Alias for :meth:`get_chat`"""
51335133
getChatAdministrators = get_chat_administrators
5134-
"""Alias for :attr:`get_chat_administrators`"""
5134+
"""Alias for :meth:`get_chat_administrators`"""
51355135
getChatMember = get_chat_member
5136-
"""Alias for :attr:`get_chat_member`"""
5136+
"""Alias for :meth:`get_chat_member`"""
51375137
setChatStickerSet = set_chat_sticker_set
5138-
"""Alias for :attr:`set_chat_sticker_set`"""
5138+
"""Alias for :meth:`set_chat_sticker_set`"""
51395139
deleteChatStickerSet = delete_chat_sticker_set
5140-
"""Alias for :attr:`delete_chat_sticker_set`"""
5140+
"""Alias for :meth:`delete_chat_sticker_set`"""
51415141
getChatMembersCount = get_chat_members_count
5142-
"""Alias for :attr:`get_chat_members_count`"""
5142+
"""Alias for :meth:`get_chat_members_count`"""
51435143
getWebhookInfo = get_webhook_info
5144-
"""Alias for :attr:`get_webhook_info`"""
5144+
"""Alias for :meth:`get_webhook_info`"""
51455145
setGameScore = set_game_score
5146-
"""Alias for :attr:`set_game_score`"""
5146+
"""Alias for :meth:`set_game_score`"""
51475147
getGameHighScores = get_game_high_scores
5148-
"""Alias for :attr:`get_game_high_scores`"""
5148+
"""Alias for :meth:`get_game_high_scores`"""
51495149
sendInvoice = send_invoice
5150-
"""Alias for :attr:`send_invoice`"""
5150+
"""Alias for :meth:`send_invoice`"""
51515151
answerShippingQuery = answer_shipping_query
5152-
"""Alias for :attr:`answer_shipping_query`"""
5152+
"""Alias for :meth:`answer_shipping_query`"""
51535153
answerPreCheckoutQuery = answer_pre_checkout_query
5154-
"""Alias for :attr:`answer_pre_checkout_query`"""
5154+
"""Alias for :meth:`answer_pre_checkout_query`"""
51555155
restrictChatMember = restrict_chat_member
5156-
"""Alias for :attr:`restrict_chat_member`"""
5156+
"""Alias for :meth:`restrict_chat_member`"""
51575157
promoteChatMember = promote_chat_member
5158-
"""Alias for :attr:`promote_chat_member`"""
5158+
"""Alias for :meth:`promote_chat_member`"""
51595159
setChatPermissions = set_chat_permissions
5160-
"""Alias for :attr:`set_chat_permissions`"""
5160+
"""Alias for :meth:`set_chat_permissions`"""
51615161
setChatAdministratorCustomTitle = set_chat_administrator_custom_title
5162-
"""Alias for :attr:`set_chat_administrator_custom_title`"""
5162+
"""Alias for :meth:`set_chat_administrator_custom_title`"""
51635163
exportChatInviteLink = export_chat_invite_link
5164-
"""Alias for :attr:`export_chat_invite_link`"""
5164+
"""Alias for :meth:`export_chat_invite_link`"""
51655165
createChatInviteLink = create_chat_invite_link
51665166
"""Alias for :attr:`create_chat_invite_link`"""
51675167
editChatInviteLink = edit_chat_invite_link
51685168
"""Alias for :attr:`edit_chat_invite_link`"""
51695169
revokeChatInviteLink = revoke_chat_invite_link
51705170
"""Alias for :attr:`revoke_chat_invite_link`"""
51715171
setChatPhoto = set_chat_photo
5172-
"""Alias for :attr:`set_chat_photo`"""
5172+
"""Alias for :meth:`set_chat_photo`"""
51735173
deleteChatPhoto = delete_chat_photo
5174-
"""Alias for :attr:`delete_chat_photo`"""
5174+
"""Alias for :meth:`delete_chat_photo`"""
51755175
setChatTitle = set_chat_title
5176-
"""Alias for :attr:`set_chat_title`"""
5176+
"""Alias for :meth:`set_chat_title`"""
51775177
setChatDescription = set_chat_description
5178-
"""Alias for :attr:`set_chat_description`"""
5178+
"""Alias for :meth:`set_chat_description`"""
51795179
pinChatMessage = pin_chat_message
5180-
"""Alias for :attr:`pin_chat_message`"""
5180+
"""Alias for :meth:`pin_chat_message`"""
51815181
unpinChatMessage = unpin_chat_message
5182-
"""Alias for :attr:`unpin_chat_message`"""
5182+
"""Alias for :meth:`unpin_chat_message`"""
51835183
unpinAllChatMessages = unpin_all_chat_messages
5184-
"""Alias for :attr:`unpin_all_chat_messages`"""
5184+
"""Alias for :meth:`unpin_all_chat_messages`"""
51855185
getStickerSet = get_sticker_set
5186-
"""Alias for :attr:`get_sticker_set`"""
5186+
"""Alias for :meth:`get_sticker_set`"""
51875187
uploadStickerFile = upload_sticker_file
5188-
"""Alias for :attr:`upload_sticker_file`"""
5188+
"""Alias for :meth:`upload_sticker_file`"""
51895189
createNewStickerSet = create_new_sticker_set
5190-
"""Alias for :attr:`create_new_sticker_set`"""
5190+
"""Alias for :meth:`create_new_sticker_set`"""
51915191
addStickerToSet = add_sticker_to_set
5192-
"""Alias for :attr:`add_sticker_to_set`"""
5192+
"""Alias for :meth:`add_sticker_to_set`"""
51935193
setStickerPositionInSet = set_sticker_position_in_set
5194-
"""Alias for :attr:`set_sticker_position_in_set`"""
5194+
"""Alias for :meth:`set_sticker_position_in_set`"""
51955195
deleteStickerFromSet = delete_sticker_from_set
5196-
"""Alias for :attr:`delete_sticker_from_set`"""
5196+
"""Alias for :meth:`delete_sticker_from_set`"""
51975197
setStickerSetThumb = set_sticker_set_thumb
5198-
"""Alias for :attr:`set_sticker_set_thumb`"""
5198+
"""Alias for :meth:`set_sticker_set_thumb`"""
51995199
setPassportDataErrors = set_passport_data_errors
5200-
"""Alias for :attr:`set_passport_data_errors`"""
5200+
"""Alias for :meth:`set_passport_data_errors`"""
52015201
sendPoll = send_poll
5202-
"""Alias for :attr:`send_poll`"""
5202+
"""Alias for :meth:`send_poll`"""
52035203
stopPoll = stop_poll
5204-
"""Alias for :attr:`stop_poll`"""
5204+
"""Alias for :meth:`stop_poll`"""
52055205
sendDice = send_dice
5206-
"""Alias for :attr:`send_dice`"""
5206+
"""Alias for :meth:`send_dice`"""
52075207
getMyCommands = get_my_commands
5208-
"""Alias for :attr:`get_my_commands`"""
5208+
"""Alias for :meth:`get_my_commands`"""
52095209
setMyCommands = set_my_commands
5210-
"""Alias for :attr:`set_my_commands`"""
5210+
"""Alias for :meth:`set_my_commands`"""
52115211
logOut = log_out
5212-
"""Alias for :attr:`log_out`"""
5212+
"""Alias for :meth:`log_out`"""
52135213
copyMessage = copy_message
5214-
"""Alias for :attr:`copy_message`"""
5214+
"""Alias for :meth:`copy_message`"""

0 commit comments

Comments
 (0)