aiogram is a modern and fully asynchronous framework for Telegram Bot API written in Python using asyncio
Find a file
Andrew df7b16d5b3
Some checks failed
Tests / tests (macos-latest, 3.10) (push) Has been cancelled
Tests / tests (macos-latest, 3.11) (push) Has been cancelled
Tests / tests (macos-latest, 3.12) (push) Has been cancelled
Tests / tests (macos-latest, 3.13) (push) Has been cancelled
Tests / tests (ubuntu-latest, 3.10) (push) Has been cancelled
Tests / tests (ubuntu-latest, 3.11) (push) Has been cancelled
Tests / tests (ubuntu-latest, 3.12) (push) Has been cancelled
Tests / tests (ubuntu-latest, 3.13) (push) Has been cancelled
Tests / tests (windows-latest, 3.10) (push) Has been cancelled
Tests / tests (windows-latest, 3.11) (push) Has been cancelled
Tests / tests (windows-latest, 3.12) (push) Has been cancelled
Tests / tests (windows-latest, 3.13) (push) Has been cancelled
Tests / pypy-tests (macos-latest, pypy3.10) (push) Has been cancelled
Tests / pypy-tests (macos-latest, pypy3.11) (push) Has been cancelled
Tests / pypy-tests (ubuntu-latest, pypy3.10) (push) Has been cancelled
Tests / pypy-tests (ubuntu-latest, pypy3.11) (push) Has been cancelled
EOL of Py3.9 (#1726)
* Drop py3.9 and pypy3.9

Add pypy3.11 (testing) into `tests.yml`

Remove py3.9 from matrix in `tests.yml`

Refactor not auto-gen code to be compatible with py3.10+, droping ugly 3.9 annotation.

Replace some `from typing` imports to `from collections.abc`, due to deprecation

Add `from __future__ import annotations` and `if TYPE_CHECKING:` where possible

Add some `noqa` to calm down Ruff in some places, if Ruff will be used as default linting+formatting tool in future

Replace some relative imports to absolute

Sort `__all__` tuples in `__init__.py` and some other `.py` files

Sort `__slots__` tuples in classes

Split raises into `msg` and `raise` (`EM101`, `EM102`) to not duplicate error message in the traceback

Add `Self` from `typing_extenstion` where possible

Resolve typing problem in `aiogram/filters/command.py:18`

Concatenate nested `if` statements

Convert `HandlerContainer` into a dataclass in `aiogram/fsm/scene.py`

Bump tests docker-compose.yml `redis:6-alpine` -> `redis:8-alpine`

Bump tests docker-compose.yml `mongo:7.0.6` -> `mongo:8.0.14`

Bump pre-commit-config `black==24.4.2` -> `black==25.9.0`

Bump pre-commit-config `ruff==0.5.1` -> `ruff==0.13.3`

Update Makefile lint for ruff to show fixes

Add `make outdated` into Makefile

Use `pathlib` instead of `os.path`

Bump `redis[hiredis]>=5.0.1,<5.3.0` -> `redis[hiredis]>=6.2.0,<7`

Bump `cryptography>=43.0.0` -> `cryptography>=46.0.0` due to security reasons

Bump `pytz~=2023.3` -> `pytz~=2025.2`

Bump `pycryptodomex~=3.19.0` -> `pycryptodomex~=3.23.0` due to security reasons

Bump linting and formatting tools

* Add `1726.removal.rst`

* Update aiogram/utils/dataclass.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update aiogram/filters/callback_data.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update 1726.removal.rst

* Remove `outdated` from Makefile

* Add `__slots__` to `HandlerContainer`

* Remove unused imports

* Add `@dataclass` with `slots=True` to `HandlerContainer`

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-06 19:19:23 +03:00
.butcher Added full support for the Bot API 9.2 (#1720) 2025-08-17 19:07:58 +03:00
.github EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
aiogram EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
CHANGES EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
docs Migrate motor to pymongo (#1705) 2025-08-17 19:16:47 +03:00
examples EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
scripts Added full support of Bot API 7.9 (#1560) 2024-08-16 00:44:40 +03:00
tests EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
.apiversion Bump version to 3.22.0 and update changelog 2025-08-17 19:18:42 +03:00
.editorconfig docs: migration feeding updates (#1531) 2024-07-06 20:33:01 +03:00
.gitattributes Added full support for the Bot API 9.2 (#1720) 2025-08-17 19:07:58 +03:00
.gitignore Migrate to hatchling (#1095) 2023-01-12 02:49:58 +02:00
.pre-commit-config.yaml EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
.readthedocs.yml Added MongoDB dependency to ReadTheDocs configuration (#1502) 2024-06-01 01:56:38 +03:00
CHANGES.rst Bump version to 3.22.0 and update changelog 2025-08-17 19:18:42 +03:00
CITATION.cff Update citation 2023-10-27 00:50:21 +03:00
codecov.yaml Remove compatibility with Python 3.7 2021-05-25 01:00:36 +03:00
CONTRIBUTING.md Fixed contributing URL 2023-04-13 00:02:15 +03:00
HISTORY.rst towncrier integration (#647) 2021-08-01 19:08:03 +03:00
LICENSE Update dates interval in license file 2023-09-03 03:16:48 +03:00
Makefile EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
pyproject.toml EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00
README.rst EOL of Py3.9 (#1726) 2025-10-06 19:19:23 +03:00

#######
aiogram
#######

.. image:: https://img.shields.io/pypi/l/aiogram.svg?style=flat-square
    :target: https://opensource.org/licenses/MIT
    :alt: MIT License

.. image:: https://img.shields.io/pypi/status/aiogram.svg?style=flat-square
    :target: https://pypi.python.org/pypi/aiogram
    :alt: PyPi status

.. image:: https://img.shields.io/pypi/v/aiogram.svg?style=flat-square
    :target: https://pypi.python.org/pypi/aiogram
    :alt: PyPi Package Version

.. image:: https://img.shields.io/pypi/dm/aiogram.svg?style=flat-square
    :target: https://pypi.python.org/pypi/aiogram
    :alt: Downloads

.. image:: https://img.shields.io/pypi/pyversions/aiogram.svg?style=flat-square
    :target: https://pypi.python.org/pypi/aiogram
    :alt: Supported python versions

.. image:: https://img.shields.io/badge/dynamic/json?color=blue&logo=telegram&label=Telegram%20Bot%20API&query=%24.api.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Faiogram%2Faiogram%2Fdev-3.x%2F.butcher%2Fschema%2Fschema.json&style=flat-square
    :target: https://core.telegram.org/bots/api
    :alt: Telegram Bot API

.. image:: https://img.shields.io/github/actions/workflow/status/aiogram/aiogram/tests.yml?branch=dev-3.x&style=flat-square
    :target: https://github.com/aiogram/aiogram/actions
    :alt: Tests

.. image:: https://img.shields.io/codecov/c/github/aiogram/aiogram?style=flat-square
    :target: https://app.codecov.io/gh/aiogram/aiogram
    :alt: Codecov

**aiogram** is a modern and fully asynchronous framework for
`Telegram Bot API <https://core.telegram.org/bots/api>`_ written in Python 3.10+ using
`asyncio <https://docs.python.org/3/library/asyncio.html>`_ and
`aiohttp <https://github.com/aio-libs/aiohttp>`_.

Make your bots faster and more powerful!

Documentation:
 - 🇺🇸 `English <https://docs.aiogram.dev/en/dev-3.x/>`_
 - 🇺🇦 `Ukrainian <https://docs.aiogram.dev/uk_UA/dev-3.x/>`_


Features
========

- Asynchronous (`asyncio docs <https://docs.python.org/3/library/asyncio.html>`_, :pep:`492`)
- Has type hints (:pep:`484`) and can be used with `mypy <http://mypy-lang.org/>`_
- Supports `PyPy <https://www.pypy.org/>`_
- Supports `Telegram Bot API 9.2 <https://core.telegram.org/bots/api>`_ and gets fast updates to the latest versions of the Bot API
- Telegram Bot API integration code was `autogenerated <https://github.com/aiogram/tg-codegen>`_ and can be easily re-generated when API gets updated
- Updates router (Blueprints)
- Has Finite State Machine
- Uses powerful `magic filters <https://docs.aiogram.dev/en/latest/dispatcher/filters/magic_filters.html#magic-filters>`_
- Middlewares (incoming updates and API calls)
- Provides `Replies into Webhook <https://core.telegram.org/bots/faq#how-can-i-make-requests-in-response-to-updates>`_
- Integrated I18n/L10n support with GNU Gettext (or Fluent)


.. warning::

    It is strongly advised that you have prior experience working
    with `asyncio <https://docs.python.org/3/library/asyncio.html>`_
    before beginning to use **aiogram**.

    If you have any questions, you can visit our community chats on Telegram:

    - 🇺🇸 `@aiogram <https://t.me/aiogram>`_
    - 🇺🇦 `@aiogramua <https://t.me/aiogramua>`_
    - 🇺🇿 `@aiogram_uz <https://t.me/aiogram_uz>`_
    - 🇰🇿 `@aiogram_kz <https://t.me/aiogram_kz>`_
    - 🇷🇺 `@aiogram_ru <https://t.me/aiogram_ru>`_
    - 🇮🇷 `@aiogram_fa <https://t.me/aiogram_fa>`_
    - 🇮🇹 `@aiogram_it <https://t.me/aiogram_it>`_
    - 🇧🇷 `@aiogram_br <https://t.me/aiogram_br>`_