mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 17:33:44 +00:00
Merge branch 'master' into dev-2.x
This commit is contained in:
commit
640b0a72a8
16 changed files with 63 additions and 7 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
[![\[Telegram\] aiogram live](https://img.shields.io/badge/telegram-aiogram-blue.svg?style=flat-square)](https://t.me/aiogram_live)
|
[![\[Telegram\] aiogram live](https://img.shields.io/badge/telegram-aiogram-blue.svg?style=flat-square)](https://t.me/aiogram_live)
|
||||||
[](https://pypi.python.org/pypi/aiogram)
|
[](https://pypi.python.org/pypi/aiogram)
|
||||||
[](https://pypi.python.org/pypi/aiogram)
|
[](https://pypi.python.org/pypi/aiogram)
|
||||||
|
[](https://pypi.python.org/pypi/aiogram)
|
||||||
[](https://pypi.python.org/pypi/aiogram)
|
[](https://pypi.python.org/pypi/aiogram)
|
||||||
[](http://aiogram.readthedocs.io/en/latest/?badge=latest)
|
[](http://aiogram.readthedocs.io/en/latest/?badge=latest)
|
||||||
[](https://github.com/aiogram/aiogram/issues)
|
[](https://github.com/aiogram/aiogram/issues)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ AIOGramBot
|
||||||
:target: https://pypi.python.org/pypi/aiogram
|
:target: https://pypi.python.org/pypi/aiogram
|
||||||
:alt: PyPi status
|
:alt: PyPi status
|
||||||
|
|
||||||
|
.. image:: https://img.shields.io/pypi/dm/aiogram.svg?style=flat-square
|
||||||
|
:target: https://pypi.python.org/pypi/aiogram
|
||||||
|
:alt: PyPi downloads
|
||||||
|
|
||||||
.. image:: https://img.shields.io/pypi/pyversions/aiogram.svg?style=flat-square
|
.. image:: https://img.shields.io/pypi/pyversions/aiogram.svg?style=flat-square
|
||||||
:target: https://pypi.python.org/pypi/aiogram
|
:target: https://pypi.python.org/pypi/aiogram
|
||||||
:alt: Supported python versions
|
:alt: Supported python versions
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@ Welcome to aiogram's documentation!
|
||||||
:target: https://pypi.python.org/pypi/aiogram
|
:target: https://pypi.python.org/pypi/aiogram
|
||||||
:alt: Supported python versions
|
:alt: Supported python versions
|
||||||
|
|
||||||
|
.. image:: https://img.shields.io/pypi/dm/aiogram.svg?style=flat-square
|
||||||
|
:target: https://pypi.python.org/pypi/aiogram
|
||||||
|
:alt: PyPi downloads
|
||||||
|
|
||||||
.. image:: https://img.shields.io/readthedocs/pip/stable.svg?style=flat-square
|
.. image:: https://img.shields.io/readthedocs/pip/stable.svg?style=flat-square
|
||||||
:target: http://aiogram.readthedocs.io/en/latest/?badge=latest
|
:target: http://aiogram.readthedocs.io/en/latest/?badge=latest
|
||||||
:alt: Documentation Status
|
:alt: Documentation Status
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,9 @@ Also you can bind your own filters for using as keyword arguments:
|
||||||
class MyFilter(BoundFilter):
|
class MyFilter(BoundFilter):
|
||||||
key = 'is_admin'
|
key = 'is_admin'
|
||||||
|
|
||||||
|
def __init__(self, is_admin):
|
||||||
|
self.is_admin = is_admin
|
||||||
|
|
||||||
async def check(self, message: types.Message):
|
async def check(self, message: types.Message):
|
||||||
member = await bot.get_chat_member(message.chat.id, message.from_user.id)
|
member = await bot.get_chat_member(message.chat.id, message.from_user.id)
|
||||||
return member.is_admin()
|
return member.is_admin()
|
||||||
|
|
|
||||||
|
|
@ -9,32 +9,32 @@ At first you have to import all necessary modules
|
||||||
|
|
||||||
.. literalinclude:: ../../examples/echo_bot.py
|
.. literalinclude:: ../../examples/echo_bot.py
|
||||||
:language: python
|
:language: python
|
||||||
:lines: 1-4
|
:lines: 6-8
|
||||||
|
|
||||||
Then you have to initialize bot and dispatcher instances.
|
Then you have to initialize bot and dispatcher instances.
|
||||||
Bot token you can get from `@BotFather <https://t.me/BotFather>`_
|
Bot token you can get from `@BotFather <https://t.me/BotFather>`_
|
||||||
|
|
||||||
.. literalinclude:: ../../examples/echo_bot.py
|
.. literalinclude:: ../../examples/echo_bot.py
|
||||||
:language: python
|
:language: python
|
||||||
:lines: 10-12
|
:lines: 10-17
|
||||||
|
|
||||||
Next step: interaction with bots starts with one command. Register your first command handler:
|
Next step: interaction with bots starts with one command. Register your first command handler:
|
||||||
|
|
||||||
.. literalinclude:: ../../examples/echo_bot.py
|
.. literalinclude:: ../../examples/echo_bot.py
|
||||||
:language: python
|
:language: python
|
||||||
:lines: 15-17
|
:lines: 21-25
|
||||||
|
|
||||||
If you want to handle all messages in the chat simply add handler without filters:
|
If you want to handle all messages in the chat simply add handler without filters:
|
||||||
|
|
||||||
.. literalinclude:: ../../examples/echo_bot.py
|
.. literalinclude:: ../../examples/echo_bot.py
|
||||||
:language: python
|
:language: python
|
||||||
:lines: 27-29
|
:lines: 28-30
|
||||||
|
|
||||||
Last step: run long polling.
|
Last step: run long polling.
|
||||||
|
|
||||||
.. literalinclude:: ../../examples/echo_bot.py
|
.. literalinclude:: ../../examples/echo_bot.py
|
||||||
:language: python
|
:language: python
|
||||||
:lines: 32-33
|
:lines: 33-34
|
||||||
|
|
||||||
Summary
|
Summary
|
||||||
-------
|
-------
|
||||||
|
|
|
||||||
4
docs/source/utils/auth_widget.rst
Normal file
4
docs/source/utils/auth_widget.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
===========
|
||||||
|
Auth Widget
|
||||||
|
===========
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/context.rst
Normal file
4
docs/source/utils/context.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
=======
|
||||||
|
Context
|
||||||
|
=======
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/deprecated.rst
Normal file
4
docs/source/utils/deprecated.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
==========
|
||||||
|
Deprecated
|
||||||
|
==========
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/emoji.rst
Normal file
4
docs/source/utils/emoji.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
=====
|
||||||
|
Emoji
|
||||||
|
=====
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/exceptions.rst
Normal file
4
docs/source/utils/exceptions.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
==========
|
||||||
|
Exceptions
|
||||||
|
==========
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/executor.rst
Normal file
4
docs/source/utils/executor.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
========
|
||||||
|
Executor
|
||||||
|
========
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/helper.rst
Normal file
4
docs/source/utils/helper.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
======
|
||||||
|
Helper
|
||||||
|
======
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/json.rst
Normal file
4
docs/source/utils/json.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
====
|
||||||
|
JSON
|
||||||
|
====
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/markdown.rst
Normal file
4
docs/source/utils/markdown.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
========
|
||||||
|
Markdown
|
||||||
|
========
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/parts.rst
Normal file
4
docs/source/utils/parts.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
=====
|
||||||
|
Parts
|
||||||
|
=====
|
||||||
|
Coming soon...
|
||||||
4
docs/source/utils/payload.rst
Normal file
4
docs/source/utils/payload.rst
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
=======
|
||||||
|
Payload
|
||||||
|
=======
|
||||||
|
Coming soon...
|
||||||
Loading…
Add table
Add a link
Reference in a new issue