2019-11-15 12:17:57 +02:00
# Overview
2020-05-27 01:24:06 +03:00
Documentation for version {!_package_version.md!} [WIP] [^1]
2019-11-15 12:17:57 +02:00
2020-04-12 20:41:10 +03:00
[](https://opensource.org/licenses/MIT)
[](https://pypi.python.org/pypi/aiogram)
[](https://core.telegram.org/bots/api)
[](https://github.com/aiogram/aiogram/actions)
[](https://pypi.python.org/pypi/aiogram)
[](https://pypi.python.org/pypi/aiogram)
[](https://pypi.python.org/pypi/aiogram)
[![\[Telegram\] aiogram live](https://img.shields.io/badge/telegram-aiogram-blue.svg)](https://t.me/aiogram_live)
2019-11-15 12:17:57 +02:00
**aiogram** modern and fully asynchronous framework for [Telegram Bot API ](https://core.telegram.org/bots/api ) written in Python 3.7 with [asyncio ](https://docs.python.org/3/library/asyncio.html ) and [aiohttp ](https://github.com/aio-libs/aiohttp ). It helps you to make your bots faster and simpler.
2019-11-16 22:32:05 +02:00
## Features
2020-04-12 20:27:32 +03:00
- Asynchronous ([asyncio docs ](https://docs.python.org/3/library/asyncio.html ), [PEP-492 ](https://www.python.org/dev/peps/pep-0492/ ))
2020-01-28 14:03:29 +02:00
- [Supports Telegram Bot API v{!_api_version.md!} ](api/index.md )
2020-01-25 18:32:47 +02:00
- [Updates router ](dispatcher/index.md ) (Blueprints)
2019-11-16 22:32:05 +02:00
- Finite State Machine
2020-05-26 20:26:29 +03:00
- [Middlewares ](dispatcher/middlewares.md )
2020-01-25 18:32:47 +02:00
- [Replies into Webhook ](https://core.telegram.org/bots/faq#how-can-i-make-requests-in-response-to-updates )
2019-11-16 22:32:05 +02:00
!!! note
Before start using **aiogram** is highly recommend to know how to work with [asyncio ](https://docs.python.org/3/library/asyncio.html ).
2020-04-12 20:27:32 +03:00
2019-11-18 18:15:15 +02:00
Also if you has questions you can go to our community chats in Telegram:
2020-04-12 20:27:32 +03:00
2019-11-16 22:32:05 +02:00
- [English language ](https://t.me/aiogram )
- [Russian language ](https://t.me/aiogram_ru )
2019-12-12 12:49:52 +02:00
## Example
Simple usage
```python3
from aiogram import Bot, Dispatcher, types
from aiogram.dispatcher.handler import MessageHandler
TOKEN = "42:TOKEN"
dp = Dispatcher()
2020-05-10 03:02:31 +04:00
@dp .message(commands=["start"])
2019-12-12 12:49:52 +02:00
class MyHandler(MessageHandler):
"""
2020-01-30 18:02:23 +02:00
This handler receive messages with `/start` command
2019-12-12 12:49:52 +02:00
"""
async def handle(self):
2020-01-28 14:03:29 +02:00
await self.event.answer(f"< b > Hello, {self.from_user.full_name}!< / b > ")
2019-12-12 12:49:52 +02:00
2020-05-10 03:02:31 +04:00
@dp .message(content_types=[types.ContentType.ANY])
2019-12-12 12:49:52 +02:00
async def echo_handler(message: types.Message, bot: Bot):
"""
Handler will forward received message back to the sender
"""
await bot.forward_message(
from_chat_id=message.chat.id, chat_id=message.chat.id, message_id=message.message_id
)
def main():
bot = Bot(TOKEN, parse_mode="HTML")
dp.run_polling(bot)
if __name__ == "__main__":
main()
```
2019-11-16 22:32:05 +02:00
## Task list for 3.0
2020-01-30 18:02:23 +02:00
Partial list of plans for this big release is listed [here ](todo.md ).
2019-11-16 23:54:53 +02:00
2019-11-18 18:15:15 +02:00
[^1]: work in progress