mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added enum docs
This commit is contained in:
parent
8011985388
commit
58c3a68696
10 changed files with 136 additions and 0 deletions
13
.butcher/templates/enum/enum.rst.jinja2
Normal file
13
.butcher/templates/enum/enum.rst.jinja2
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{{ object.name|header('#') }}
|
||||
{{ object.name }}
|
||||
{{ object.name|header('#') }}
|
||||
|
||||
|
||||
.. automodule:: aiogram.enums.{{ object.name|pythonize_name }}
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
||||
{% if docs %}
|
||||
{{ docs }}
|
||||
{% endif %}
|
||||
54
.butcher/templates/method/method.rst.jinja2
Executable file
54
.butcher/templates/method/method.rst.jinja2
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
{{ object.name|header('#') }}
|
||||
{{ object.name }}
|
||||
{{ object.name|header('#') }}
|
||||
|
||||
Returns: :obj:`{{ object.returning.parsed_type|type }}`
|
||||
|
||||
.. automodule:: aiogram.methods.{{ object.name|pythonize_name }}
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
As bot method
|
||||
-------------
|
||||
|
||||
.. code-block::
|
||||
|
||||
result: {{ object.returning.parsed_type|type }} = await bot.{{ object.name|pythonize_name }}(...)
|
||||
|
||||
|
||||
Method as object
|
||||
----------------
|
||||
|
||||
Imports:
|
||||
|
||||
- :code:`from aiogram.methods.{{ object.name|pythonize_name }} import {{ object.name|pythonize_class_name }}`
|
||||
- alias: :code:`from aiogram.methods import {{ object.name|pythonize_class_name }}`
|
||||
|
||||
With specific bot
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
result: {{ object.returning.parsed_type|type }} = await bot({{ object.name|pythonize_class_name }}(...))
|
||||
|
||||
{% if can_be_used_in_webhook -%}
|
||||
As reply into Webhook in handler
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
return {{ object.name|pythonize_class_name }}(...)
|
||||
{%- endif %}
|
||||
|
||||
{% if aliased %}
|
||||
As shortcut from received object
|
||||
-------------------
|
||||
{% for alias in aliased %}
|
||||
- :meth:`aiogram.types.{{ alias.type|pythonize_name }}.{{ alias.type|pythonize_class_name }}.{{ alias.name }}`
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
9
.butcher/templates/type/type.rst.jinja2
Normal file
9
.butcher/templates/type/type.rst.jinja2
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{{ object.name|header('#') }}
|
||||
{{ object.name }}
|
||||
{{ object.name|header('#') }}
|
||||
|
||||
|
||||
.. automodule:: aiogram.types.{{ object.name|pythonize_name }}
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
9
docs/api/enums/chat_type.rst
Normal file
9
docs/api/enums/chat_type.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
########
|
||||
ChatType
|
||||
########
|
||||
|
||||
|
||||
.. automodule:: aiogram.enums.chat_type
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
9
docs/api/enums/content_type.rst
Normal file
9
docs/api/enums/content_type.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
###########
|
||||
ContentType
|
||||
###########
|
||||
|
||||
|
||||
.. automodule:: aiogram.enums.content_type
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
9
docs/api/enums/dice_emoji.rst
Normal file
9
docs/api/enums/dice_emoji.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#########
|
||||
DiceEmoji
|
||||
#########
|
||||
|
||||
|
||||
.. automodule:: aiogram.enums.dice_emoji
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
14
docs/api/enums/index.rst
Normal file
14
docs/api/enums/index.rst
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#####
|
||||
Enums
|
||||
#####
|
||||
|
||||
Here is list of all available enums:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
chat_type
|
||||
content_type
|
||||
dice_emoji
|
||||
topic_icon_color
|
||||
update_type
|
||||
9
docs/api/enums/topic_icon_color.rst
Normal file
9
docs/api/enums/topic_icon_color.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
##############
|
||||
TopicIconColor
|
||||
##############
|
||||
|
||||
|
||||
.. automodule:: aiogram.enums.topic_icon_color
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
9
docs/api/enums/update_type.rst
Normal file
9
docs/api/enums/update_type.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
##########
|
||||
UpdateType
|
||||
##########
|
||||
|
||||
|
||||
.. automodule:: aiogram.enums.update_type
|
||||
:members:
|
||||
:member-order: bysource
|
||||
:undoc-members: True
|
||||
|
|
@ -11,5 +11,6 @@ All methods and types is fully autogenerated from Telegram Bot API docs by parse
|
|||
session/index
|
||||
types/index
|
||||
methods/index
|
||||
enums/index
|
||||
download_file
|
||||
upload_file
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue