Skip to content

Commit

Permalink
Documentation Improvements (#4217)
Browse files Browse the repository at this point in the history
Co-authored-by: poolitzer <github@poolitzer.eu>
  • Loading branch information
Bibo-Joshi and Poolitzer committed May 20, 2024
1 parent b496fab commit 7d952d8
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Check-list for PRs
This checklist is a non-exhaustive reminder of things that should be done before a PR is merged, both for you as contributor and for the maintainers.
Feel free to copy (parts of) the checklist to the PR description to remind you or the maintainers of open points or if you have questions on anything.

- Added ``.. versionadded:: NEXT.VERSION``, ``.. versionchanged:: NEXT.VERSION`` or ``.. deprecated:: NEXT.VERSION`` to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
- Added ``.. versionadded:: NEXT.VERSION``, ``.. versionchanged:: NEXT.VERSION``, ``.. deprecated:: NEXT.VERSION`` or ``.. versionremoved:: NEXT.VERSION`` to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
- Created new or adapted existing unit tests
- Documented code changes according to the `CSI standard <https://standards.mousepawmedia.com/en/stable/csi.html>`__
- Added myself alphabetically to ``AUTHORS.rst`` (optional)
Expand Down Expand Up @@ -276,7 +276,7 @@ This gives us the flexibility to re-order arguments and more importantly
to add new required arguments. It's also more explicit and easier to read.


.. _`Code of Conduct`: https://www.python.org/psf/conduct/
.. _`Code of Conduct`: https://policies.python.org/python.org/code-of-conduct/
.. _`issue tracker`: https://github.com/python-telegram-bot/python-telegram-bot/issues
.. _`Telegram group`: https://telegram.me/pythontelegrambotgroup
.. _`PEP 8 Style Guide`: https://peps.python.org/pep-0008/
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ body:
To make it easier for us to help you, please read this [article](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Ask-Right).
Please mind that there is also a users' [Telegram group](https://t.me/pythontelegrambotgroup) for questions about the library. Questions asked there might be answered quicker than here. Moreover, [GitHub Discussions](https://github.com/python-telegram-bot/python-telegram-bot/discussions) offer a slightly better format to discuss usage questions.
If you have asked the same question elsewhere (e.g. the [Telegram group](https://t.me/pythontelegrambotgroup) or [StackOverflow](https://stackoverflow.com/questions/tagged/python-telegram-bot)), provide a link to that thread.
- type: textarea
id: issue-faced
Expand Down
2 changes: 1 addition & 1 deletion telegram/_birthdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(
self._freeze()

def to_date(self, year: Optional[int] = None) -> date:
"""Return the birthdate as a datetime object.
"""Return the birthdate as a date object.
.. versionchanged:: NEXT.VERSION
Now returns a :obj:`datetime.date` object instead of a :obj:`datetime.datetime` object,
Expand Down
10 changes: 5 additions & 5 deletions telegram/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ class Chat(TelegramObject):
In accordance to Bot API 7.3, this attribute will be moved to
:class:`telegram.ChatFullInfo`.
join_by_request (:obj:`bool`, optional): :obj:`True`, if all users directly joining the
supergroup need to be approved by supergroup administrators. Returned only in
:meth:`telegram.Bot.get_chat`.
supergroup without using an invite link need to be approved by supergroup
administrators. Returned only in :meth:`telegram.Bot.get_chat`.
.. versionadded:: 20.0
Expand Down Expand Up @@ -563,9 +563,9 @@ class Chat(TelegramObject):
.. deprecated:: NEXT.VERSION
In accordance to Bot API 7.3, this attribute will be moved to
:class:`telegram.ChatFullInfo`.
join_by_request (:obj:`bool`): Optional. :obj:`True`, if all users directly
joining the supergroup need to be approved by supergroup administrators. Returned only
in :meth:`telegram.Bot.get_chat`.
join_by_request (:obj:`bool`): Optional. :obj:`True`, if all users directly joining the
supergroup without using an invite link need to be approved by supergroup
administrators. Returned only in :meth:`telegram.Bot.get_chat`.
.. versionadded:: 20.0
Expand Down
8 changes: 4 additions & 4 deletions telegram/_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ class Update(TelegramObject):
.. versionadded:: 21.1
business_message (:class:`telegram.Message`, optional): New non-service message
from a connected business account.
business_message (:class:`telegram.Message`, optional): New message from a connected
business account.
.. versionadded:: 21.1
Expand Down Expand Up @@ -249,8 +249,8 @@ class Update(TelegramObject):
.. versionadded:: 21.1
business_message (:class:`telegram.Message`): Optional. New non-service message
from a connected business account.
business_message (:class:`telegram.Message`): Optional. New message from a connected
business account.
.. versionadded:: 21.1
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_handlers/stringcommandhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class StringCommandHandler(BaseHandler[str, CCT]):
called when :meth:`check_update` has determined that an update should be processed by
this handler. Callback signature::
async def callback(update: Update, context: CallbackContext)
async def callback(update: str, context: CallbackContext)
The return value of the callback is usually ignored except for the special case of
:class:`telegram.ext.ConversationHandler`.
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_handlers/stringregexhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class StringRegexHandler(BaseHandler[str, CCT]):
called when :meth:`check_update` has determined that an update should be processed by
this handler. Callback signature::
async def callback(update: Update, context: CallbackContext)
async def callback(update: str, context: CallbackContext)
The return value of the callback is usually ignored except for the special case of
:class:`telegram.ext.ConversationHandler`.
Expand Down
2 changes: 1 addition & 1 deletion telegram/ext/_handlers/typehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TypeHandler(BaseHandler[UT, CCT]):
called when :meth:`check_update` has determined that an update should be processed by
this handler. Callback signature::
async def callback(update: Update, context: CallbackContext)
async def callback(update: object, context: CallbackContext)
The return value of the callback is usually ignored except for the special case of
:class:`telegram.ext.ConversationHandler`.
Expand Down

0 comments on commit 7d952d8

Please sign in to comment.