Repository: python-telegram-bot/python-telegram-bot

Issue:
[ENHANCEMENT] adding "added/changed/depreciated/removed in version XX.X" to docs
This is an enhancement we discussed internally already but I wanted to focus this discussion in an issue. An example for this version hinting is[PyMongo](https://pymongo.readthedocs.io/en/stable/api/pymongo/collection.html#pymongo.GEOHAYSTACK).

I dont think it is necessary to do this hinting for earlier versions, but we could start with the next one.


Discussion:
Looked arount a bit and there are Sphinx directives for that:

```
def foo_bar(…)
        """
       FooBar
        .. versionchanged:: X.Y
           Optional Description

        .. versionadded:: X.Y
           Optional Description

        .. deprecated:: X.Y
           Optional Description
        """
```

We should use those.
I suggest that we do a PR adding those to all changes since 13.1 and either merge it last or update all following PRs to include this.

PS: there is no `.. versionremoved`, because well, the method/class no longer as a documentation then ;)
yay I love that suggestion great will do once I cleaned my notifications

Resolving patch:
diff --git a/telegram/bot.py b/telegram/bot.py
--- a/telegram/bot.py
+++ b/telegram/bot.py
@@ -595,6 +595,8 @@ def send_photo(
             filename (:obj:`str`, optional): Custom file name for the photo, when uploading a
                 new file. Convenience parameter, useful e.g. when sending files generated by the
                 :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
             caption (:obj:`str`, optional): Photo caption (may also be used when resending photos
                 by file_id), 0-1024 characters after entities parsing.
             parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to
@@ -691,6 +693,8 @@ def send_audio(
             filename (:obj:`str`, optional): Custom file name for the audio, when uploading a
                 new file. Convenience parameter, useful e.g. when sending files generated by the
                 :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
             caption (:obj:`str`, optional): Audio caption, 0-1024 characters after entities
                 parsing.
             parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to
@@ -970,6 +974,8 @@ def send_video(
             filename (:obj:`str`, optional): Custom file name for the video, when uploading a
                 new file. Convenience parameter, useful e.g. when sending files generated by the
                 :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
             duration (:obj:`int`, optional): Duration of sent video in seconds.
             width (:obj:`int`, optional): Video width.
             height (:obj:`int`, optional): Video height.
@@ -1081,6 +1087,8 @@ def send_video_note(
             filename (:obj:`str`, optional): Custom file name for the video note, when uploading a
                 new file. Convenience parameter, useful e.g. when sending files generated by the
                 :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
             duration (:obj:`int`, optional): Duration of sent video in seconds.
             length (:obj:`int`, optional): Video width and height, i.e. diameter of the video
                 message.
@@ -1175,6 +1183,8 @@ def send_animation(
             filename (:obj:`str`, optional): Custom file name for the animation, when uploading a
                 new file. Convenience parameter, useful e.g. when sending files generated by the
                 :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
             duration (:obj:`int`, optional): Duration of sent animation in seconds.
             width (:obj:`int`, optional): Animation width.
             height (:obj:`int`, optional): Animation height.
@@ -1282,6 +1292,8 @@ def send_voice(
             filename (:obj:`str`, optional): Custom file name for the voice, when uploading a
                 new file. Convenience parameter, useful e.g. when sending files generated by the
                 :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
             caption (:obj:`str`, optional): Voice message caption, 0-1024 characters after entities
                 parsing.
             parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to
diff --git a/telegram/files/inputmedia.py b/telegram/files/inputmedia.py
--- a/telegram/files/inputmedia.py
+++ b/telegram/files/inputmedia.py
@@ -81,6 +81,8 @@ class InputMediaAnimation(InputMedia):
         filename (:obj:`str`, optional): Custom file name for the animation, when uploading a
             new file. Convenience parameter, useful e.g. when sending files generated by the
             :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
         thumb (`filelike object` | :class:`pathlib.Path`, optional): Thumbnail of the file sent;
             can be ignored if
             thumbnail generation for the file is supported server-side. The thumbnail should be
@@ -161,6 +163,8 @@ class InputMediaPhoto(InputMedia):
         filename (:obj:`str`, optional): Custom file name for the photo, when uploading a
             new file. Convenience parameter, useful e.g. when sending files generated by the
             :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
         caption (:obj:`str`, optional ): Caption of the photo to be sent, 0-1024 characters after
             entities parsing.
         parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show
@@ -213,6 +217,8 @@ class InputMediaVideo(InputMedia):
         filename (:obj:`str`, optional): Custom file name for the video, when uploading a
             new file. Convenience parameter, useful e.g. when sending files generated by the
             :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
         caption (:obj:`str`, optional): Caption of the video to be sent, 0-1024 characters after
             entities parsing.
         parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show
@@ -306,6 +312,8 @@ class InputMediaAudio(InputMedia):
         filename (:obj:`str`, optional): Custom file name for the audio, when uploading a
             new file. Convenience parameter, useful e.g. when sending files generated by the
             :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
         caption (:obj:`str`, optional): Caption of the audio to be sent, 0-1024 characters after
             entities parsing.
         parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show
@@ -391,6 +399,8 @@ class InputMediaDocument(InputMedia):
         filename (:obj:`str`, optional): Custom file name for the document, when uploading a
             new file. Convenience parameter, useful e.g. when sending files generated by the
             :obj:`tempfile` module.
+
+                .. versionadded:: 13.1
         caption (:obj:`str`, optional): Caption of the document to be sent, 0-1024 characters after
             entities parsing.
         parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to show
diff --git a/telegram/message.py b/telegram/message.py
--- a/telegram/message.py
+++ b/telegram/message.py
@@ -982,6 +982,8 @@ def reply_copy(
                 this parameter will be ignored. Default: :obj:`True` in group chats and
                 :obj:`False` in private chats.
 
+                .. versionadded:: 13.1
+
         Returns:
             :class:`telegram.MessageId`: On success, returns the MessageId of the sent message.
 


Test patch: