Skip to content

Commit 2d7a974

Browse files
authored
Start Using Versioning Directives in Docs (python-telegram-bot#2252)
* adding versioning in sphinx, closing python-telegram-bot#2250 * adding version requirement to contributors doc
1 parent ef703d1 commit 2d7a974

4 files changed

Lines changed: 26 additions & 0 deletions

File tree

.github/CONTRIBUTING.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ Here's how to make a one-off code change.
9191
9292
Once the process terminates, you can view the built documentation by opening ``docs/build/html/index.html`` with a browser.
9393

94+
- Add ``.. versionadded:: version``, ``.. versionchanged:: version`` or ``.. deprecated:: version`` to the associated documentation of your changes, depending on what kind of change you made. This only applies if the change you made is visible to an end user.
95+
9496
- For consistency, please conform to `Google Python Style Guide`_ and `Google Python Style Docstrings`_.
9597

9698
- The following exceptions to the above (Google's) style guides applies:

telegram/bot.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,8 @@ def send_photo(
595595
filename (:obj:`str`, optional): Custom file name for the photo, when uploading a
596596
new file. Convenience parameter, useful e.g. when sending files generated by the
597597
:obj:`tempfile` module.
598+
599+
.. versionadded:: 13.1
598600
caption (:obj:`str`, optional): Photo caption (may also be used when resending photos
599601
by file_id), 0-1024 characters after entities parsing.
600602
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to
@@ -691,6 +693,8 @@ def send_audio(
691693
filename (:obj:`str`, optional): Custom file name for the audio, when uploading a
692694
new file. Convenience parameter, useful e.g. when sending files generated by the
693695
:obj:`tempfile` module.
696+
697+
.. versionadded:: 13.1
694698
caption (:obj:`str`, optional): Audio caption, 0-1024 characters after entities
695699
parsing.
696700
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to
@@ -970,6 +974,8 @@ def send_video(
970974
filename (:obj:`str`, optional): Custom file name for the video, when uploading a
971975
new file. Convenience parameter, useful e.g. when sending files generated by the
972976
:obj:`tempfile` module.
977+
978+
.. versionadded:: 13.1
973979
duration (:obj:`int`, optional): Duration of sent video in seconds.
974980
width (:obj:`int`, optional): Video width.
975981
height (:obj:`int`, optional): Video height.
@@ -1081,6 +1087,8 @@ def send_video_note(
10811087
filename (:obj:`str`, optional): Custom file name for the video note, when uploading a
10821088
new file. Convenience parameter, useful e.g. when sending files generated by the
10831089
:obj:`tempfile` module.
1090+
1091+
.. versionadded:: 13.1
10841092
duration (:obj:`int`, optional): Duration of sent video in seconds.
10851093
length (:obj:`int`, optional): Video width and height, i.e. diameter of the video
10861094
message.
@@ -1175,6 +1183,8 @@ def send_animation(
11751183
filename (:obj:`str`, optional): Custom file name for the animation, when uploading a
11761184
new file. Convenience parameter, useful e.g. when sending files generated by the
11771185
:obj:`tempfile` module.
1186+
1187+
.. versionadded:: 13.1
11781188
duration (:obj:`int`, optional): Duration of sent animation in seconds.
11791189
width (:obj:`int`, optional): Animation width.
11801190
height (:obj:`int`, optional): Animation height.
@@ -1282,6 +1292,8 @@ def send_voice(
12821292
filename (:obj:`str`, optional): Custom file name for the voice, when uploading a
12831293
new file. Convenience parameter, useful e.g. when sending files generated by the
12841294
:obj:`tempfile` module.
1295+
1296+
.. versionadded:: 13.1
12851297
caption (:obj:`str`, optional): Voice message caption, 0-1024 characters after entities
12861298
parsing.
12871299
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to

telegram/files/inputmedia.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ class InputMediaAnimation(InputMedia):
8181
filename (:obj:`str`, optional): Custom file name for the animation, when uploading a
8282
new file. Convenience parameter, useful e.g. when sending files generated by the
8383
:obj:`tempfile` module.
84+
85+
.. versionadded:: 13.1
8486
thumb (`filelike object` | :class:`pathlib.Path`, optional): Thumbnail of the file sent;
8587
can be ignored if
8688
thumbnail generation for the file is supported server-side. The thumbnail should be
@@ -161,6 +163,8 @@ class InputMediaPhoto(InputMedia):
161163
filename (:obj:`str`, optional): Custom file name for the photo, when uploading a
162164
new file. Convenience parameter, useful e.g. when sending files generated by the
163165
:obj:`tempfile` module.
166+
167+
.. versionadded:: 13.1
164168
caption (:obj:`str`, optional ): Caption of the photo to be sent, 0-1024 characters after
165169
entities parsing.
166170
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show
@@ -213,6 +217,8 @@ class InputMediaVideo(InputMedia):
213217
filename (:obj:`str`, optional): Custom file name for the video, when uploading a
214218
new file. Convenience parameter, useful e.g. when sending files generated by the
215219
:obj:`tempfile` module.
220+
221+
.. versionadded:: 13.1
216222
caption (:obj:`str`, optional): Caption of the video to be sent, 0-1024 characters after
217223
entities parsing.
218224
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show
@@ -306,6 +312,8 @@ class InputMediaAudio(InputMedia):
306312
filename (:obj:`str`, optional): Custom file name for the audio, when uploading a
307313
new file. Convenience parameter, useful e.g. when sending files generated by the
308314
:obj:`tempfile` module.
315+
316+
.. versionadded:: 13.1
309317
caption (:obj:`str`, optional): Caption of the audio to be sent, 0-1024 characters after
310318
entities parsing.
311319
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show
@@ -391,6 +399,8 @@ class InputMediaDocument(InputMedia):
391399
filename (:obj:`str`, optional): Custom file name for the document, when uploading a
392400
new file. Convenience parameter, useful e.g. when sending files generated by the
393401
:obj:`tempfile` module.
402+
403+
.. versionadded:: 13.1
394404
caption (:obj:`str`, optional): Caption of the document to be sent, 0-1024 characters after
395405
entities parsing.
396406
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show

telegram/message.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,8 @@ def reply_copy(
982982
this parameter will be ignored. Default: :obj:`True` in group chats and
983983
:obj:`False` in private chats.
984984
985+
.. versionadded:: 13.1
986+
985987
Returns:
986988
:class:`telegram.MessageId`: On success, returns the MessageId of the sent message.
987989

0 commit comments

Comments
 (0)