Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Resources
- The `package documentation <https://docs.python-telegram-bot.org/>`_ is the technical reference for ``python-telegram-bot``.
It contains descriptions of all available classes, modules, methods and arguments as well as the `changelog <https://docs.python-telegram-bot.org/changelog.html>`_.
- The `wiki <https://github.com/python-telegram-bot/python-telegram-bot/wiki/>`_ is home to number of more elaborate introductions of the different features of ``python-telegram-bot`` and other useful resources that go beyond the technical documentation.
- Our `examples section <https://docs.python-telegram-bot.org/examples.html>`_ contains several examples that showcase the different features of both the Bot API and ``python-telegram-bot``.
- Our `examples section <https://docs.python-telegram-bot.org/examples/index.html>`_ contains several examples that showcase the different features of both the Bot API and ``python-telegram-bot``.
Even if it is not your approach for learning, please take a look at ``echobot.py``. It is the de facto base for most of the bots out there.
The code for these examples is released to the public domain, so you can start by grabbing the code and building on top of it.
- The `official Telegram Bot API documentation <https://core.telegram.org/bots/api>`_ is of course always worth a read.
Expand Down
459 changes: 459 additions & 0 deletions docs/auxil/api_docs.py

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions docs/source/_templates/ptb-object.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. Autogenerated page: True

{{ objname | escape | underline }}

.. currentmodule:: {{ module }}

.. auto{{ objtype }}:: {{ objname }}{% if objtype in ["class", "exception"] %}
:members:
:show-inheritance:{% endif %}
5 changes: 5 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
extensions = [
"chango.sphinx_ext",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.linkcode",
Expand All @@ -51,6 +52,7 @@
"sphinx_copybutton",
"sphinx_inline_tabs",
"sphinxcontrib.mermaid",
"docs.auxil.api_docs",
]

# Temporary. See #4387
Expand Down Expand Up @@ -80,6 +82,9 @@
# You can specify multiple suffix as a list of string:
source_suffix = ".rst"

# API fragments are included by generated dotted-name wrappers. Example pages are read in place.
exclude_patterns = ["telegram/**", "telegram_auxil/**"]

# The master toctree document.
master_doc = "index"

Expand Down
7 changes: 0 additions & 7 deletions docs/source/examples.chatmemberbot.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.contexttypesbot.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.deeplinking.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.echobot.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.errorhandlerbot.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.inlinebot.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.inlinekeyboard.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.inlinekeyboard2.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.paymentbot.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.pollbot.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/source/examples.timerbot.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.. Autogenerated page: False

``arbitrarycallbackdatabot.py``
===============================

.. literalinclude:: ../../examples/arbitrarycallbackdatabot.py
.. literalinclude:: ../../../examples/arbitrarycallbackdatabot.py
:language: python
:linenos:

8 changes: 8 additions & 0 deletions docs/source/examples/chatmemberbot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Autogenerated page: False

``chatmemberbot.py``
====================

.. literalinclude:: ../../../examples/chatmemberbot.py
:language: python
:linenos:
8 changes: 8 additions & 0 deletions docs/source/examples/contexttypesbot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Autogenerated page: False

``contexttypesbot.py``
======================

.. literalinclude:: ../../../examples/contexttypesbot.py
:language: python
:linenos:
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.. Autogenerated page: False

``conversationbot.py``
======================

.. literalinclude:: ../../examples/conversationbot.py
.. literalinclude:: ../../../examples/conversationbot.py
:language: python
:linenos:

Expand All @@ -10,4 +12,4 @@
State Diagram
-------------

.. mermaid:: ../../examples/conversationbot.mmd
.. mermaid:: ../../../examples/conversationbot.mmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.. Autogenerated page: False

``conversationbot2.py``
=======================

.. literalinclude:: ../../examples/conversationbot2.py
.. literalinclude:: ../../../examples/conversationbot2.py
:language: python
:linenos:

Expand All @@ -10,4 +12,4 @@
State Diagram
-------------

.. mermaid:: ../../examples/conversationbot2.mmd
.. mermaid:: ../../../examples/conversationbot2.mmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. Autogenerated page: False

``customwebhookbot.py``
=======================

Expand All @@ -19,25 +21,24 @@ You can select your preferred framework by opening one of the tabs above the cod

.. tab:: ``starlette``

.. literalinclude:: ../../examples/customwebhookbot/starlettebot.py
.. literalinclude:: ../../../examples/customwebhookbot/starlettebot.py
:language: python
:linenos:

.. tab:: ``flask``

.. literalinclude:: ../../examples/customwebhookbot/flaskbot.py
.. literalinclude:: ../../../examples/customwebhookbot/flaskbot.py
:language: python
:linenos:

.. tab:: ``quart``

.. literalinclude:: ../../examples/customwebhookbot/quartbot.py
.. literalinclude:: ../../../examples/customwebhookbot/quartbot.py
:language: python
:linenos:

.. tab:: ``Django``

.. literalinclude:: ../../examples/customwebhookbot/djangobot.py
.. literalinclude:: ../../../examples/customwebhookbot/djangobot.py
:language: python
:linenos:

8 changes: 8 additions & 0 deletions docs/source/examples/deeplinking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Autogenerated page: False

``deeplinking.py``
==================

.. literalinclude:: ../../../examples/deeplinking.py
:language: python
:linenos:
8 changes: 8 additions & 0 deletions docs/source/examples/echobot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Autogenerated page: False

``echobot.py``
==============

.. literalinclude:: ../../../examples/echobot.py
:language: python
:linenos:
8 changes: 8 additions & 0 deletions docs/source/examples/errorhandlerbot.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. Autogenerated page: False

``errorhandlerbot.py``
======================

.. literalinclude:: ../../../examples/errorhandlerbot.py
:language: python
:linenos:
Loading