Commit graph

143 commits

Author SHA1 Message Date
Alex Root Junior
b94123de3d
Remove commands= from examples 2023-09-06 00:50:46 +03:00
Alex Root Junior
2cf224da49
Reformat code 2023-08-26 22:34:30 +03:00
Alex Root Junior
b7be9c2b81
Small cleanup in examples 2023-08-21 01:13:19 +03:00
Danipulok
16649ec896
Add error handling example (#1099)
* Add error handling example

* Add `ExceptionMessageFilter` usage

* Add `CHANGES`

* Update CHANGES/1099.doc.rst

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2023-08-14 23:43:44 +03:00
Alex Root Junior
8ff992bf1d
Content from global filters (#1267)
* Move global filters check placement into router to add chance to pass context from global filters into handlers in the same way as it possible in other places

* Added changelog
2023-08-14 22:18:11 +03:00
Kostiantyn Kriuchkov
fac0a533b0
Examples/dev 3x multi file (#1254)
* Add multi-file bot example

This commit adds a multi-file bot example to the repository. .

* Refactor: Clean up code formatting for consistency

* add Changelog

* Refactor bot code, fix changelog version
2023-08-13 18:00:59 +03:00
nullmatawasoradesu
f87deea4fb
Added a section on Dependency Injection technology in documentation (#1253)
* Added a section on Dependency Injection technology in documentation

* Added changelog

* Edited comments & titles
2023-08-13 17:59:38 +03:00
Alex Root Junior
020db29e6d
Fixed line length 2023-08-13 17:01:21 +03:00
Kostiantyn Kriuchkov
c516ea9d6a
Refactor and improve bot examples (#1256)
* Refactor and improve bot messages

Refactored bot code to use aiogram enumerations and enhanced chat messages with markdown beautifications for a more user-friendly display.

CommandStart() is now used instead of Command('start') for readability.

Furthermore, the bot's 'stop' command was improved, ensuring it executes appropriately during KeyboardInterrupt or SystemExit.

Additionally, the bot's logging was adjusted to output to sys.stdout for better logs' readability.

* Added Changelog

* Add guidance comments on obtaining bot tokens from environment variables

* Remove hardcoded tokens, opt for environment variable

* Remove unnecessary spaces and reorganize imports

* Fix error, switch default storage from Redis to Memory, and add logging to multibot example
2023-08-10 22:10:30 +03:00
Alex Root Junior
b311d59fce
Webhook docs (#1248)
* Added documentation for polling/webhook modes

* Added changelog

* Added changelog
2023-08-06 16:59:29 +03:00
Andrey
2dd019d486
Fix typo (#1164) 2023-04-17 00:31:33 +03:00
Alex Root Junior
46218b8696
Towncrier build 2023-02-19 18:10:11 +02:00
Alex Root Junior
a332e88bc3
Fixed lines in FSM example 2023-02-13 00:55:53 +02:00
Alex Root Junior
f4ce4431f9
Migrate to hatchling (#1095)
* Migrate to hatchling instead of poetry, ruff instead of flake8

* Migrate to hatchling instead of poetry, ruff instead of flake8

* Update tests suite

* venv?

* -m venv?

* Change dependencies

* Remove venv

* Change mypy config

* Added changelog

* Mark uvloop incompatible with pypy

* Update release script

* Use internal caching for dependencies

* Re-disable cov branches

* Added contributing guide
2023-01-12 02:49:58 +02:00
Alex Root Junior
f4251382e8
Remove filters factory, introduce docs translation (#978)
* Rewrite filters

* Update README.rst

* Fixed tests

* Small optimization of the Text filter (TY to @bomzheg)

* Remove dataclass slots argument in due to the only Python 3.10 has an slots argument

* Fixed mypy

* Update tests

* Disable Python 3.11

* Fixed #1013: Empty mention should be None instead of empty string.

* Added #990 to the changelog

* Added #942 to the changelog

* Fixed coverage

* Update poetry and dependencies

* Fixed mypy

* Remove deprecated code

* Added more tests, update pyproject.toml

* Partial update docs

* Added initial Docs translation files

* Added more changes

* Added log message when connection is established in polling process

* Fixed action

* Disable lint for PyPy

* Added changelog for docs translation
2022-10-02 00:04:31 +03:00
Alex Root Junior
0e0dbe7e59
Deprecate filters factory (#976)
* Deprecate filters factory

* Added changelog

* Update filters usage in docs and examples
2022-08-14 18:40:41 +03:00
Alex Root Junior
4315ecf1a2
Dev 3.x flat package (#961)
* Move packages

* Added changelog

* Update examples/echo_bot.py

Co-authored-by: Oleg A. <t0rr@mail.ru>

* Rename `handler` -> `handlers`

* Update __init__.py

Co-authored-by: Oleg A. <t0rr@mail.ru>
2022-08-14 01:07:52 +03:00
Alex Root Junior
497436595d
[3.x] Bot API 6.0 (#890)
* Base implementation

* Bump license

* Revert re-generated tests

* Fix tests, improved docs

* Remove TODO

* Removed unreachable code

* Changed type of `last_synchronization_error_date`

* Fixed wrongly cleaned code
2022-04-19 22:03:24 +03:00
Alex Root Junior
286cf39c8a
Beta 3 (#884)
* Rework middlewares, separate management to `MiddlewareManager` class

* Rework middlewares

* Added changes description for redis

* Added changes description for redis

* Fixed tests with Redis // aioredis replacement

* Changed msg.<html/md>_text attributes behaviour

* Added changelog for spoilers

* Added possibility to get command magic result as handler arguments
2022-04-16 19:07:32 +03:00
Gabben
a37bbba38c
Fix docs and examples (#864)
* Update magic_data Allowed handlers

* Fix ChatMemberUpdated example

* Fix examples with `.in_(...)` and delete with `@`

* Fix commands in examples

* Change List to Set
2022-03-26 17:30:46 +02:00
Alex Root Junior
1634dc1162 Bump version, small changes in docs 2021-12-12 18:59:57 +02:00
Alex Root Junior
1c2c7fd88c
Webhook integration in 3.0 (#737)
* Added base webhook implementation and example
* Added example
* Enable on_startup callback
* Correctly handle response into webhook (silent call)
* Fixed State filter
2021-11-08 23:20:12 +02:00
Alex Root Junior
f97367b3ee More docs 2021-10-12 01:11:53 +03:00
Alex Root Junior
cfd2a9968e
Reworked handlers in use (#682)
* Reworked handlers in use util

* Added patch-notes
2021-09-07 01:04:33 +03:00
Alex Root Junior
e356ede5de
Updated pre-commit hook (#681)
* Updated pre-commit config and reformat code

* Added changelog
2021-09-07 00:32:43 +03:00
Forevka
125fc22ff9
Added ability to specify which update bot need to receive and process while using polling mode (#617)
* provide allowed_updates in polling mode
2021-07-05 01:41:27 +03:00
Alex Root Junior
79f21416c8 Added lost files 2021-05-25 01:00:58 +03:00
Alex Root Junior
f022b4441c Added more aliases, refactor CallbackData factory, added base exceptions classification mechanism 2021-05-25 00:56:44 +03:00
Alex Root Junior
4008a3114d
Upgrade architecture + 5.0 Bot API (#469)
Upgrade architecture + 5.0 Bot API (#469)
* Moved `methods`, `types` and `client` to root package
* Removed update handler from routers to dispatcher
* Reworked events propagation mechanism to handlers
* Reworked inner middlewares logic (very small change)
* Updated to Bot API 5.0
* Initial migration from MkDocs to Sphinx + config for readthedocs
2021-01-26 21:20:52 +02:00
jrootjunior
65815e509f Clean obsolete code and change configs 2019-11-15 12:44:24 +02:00
Alex Root Junior
87393f2475 Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x
# Conflicts:
#	README.md
#	README.rst
#	aiogram/__init__.py
#	aiogram/bot/bot.py
#	aiogram/contrib/fsm_storage/redis.py
#	aiogram/contrib/middlewares/logging.py
#	aiogram/dispatcher/dispatcher.py
#	aiogram/dispatcher/filters/__init__.py
#	aiogram/dispatcher/filters/builtin.py
#	aiogram/dispatcher/filters/filters.py
#	aiogram/dispatcher/filters/state.py
#	aiogram/dispatcher/handler.py
#	aiogram/dispatcher/webhook.py
#	aiogram/types/base.py
#	aiogram/types/chat.py
#	aiogram/types/chat_member.py
#	aiogram/types/input_media.py
#	aiogram/types/message.py
#	aiogram/utils/callback_data.py
#	aiogram/utils/deprecated.py
#	aiogram/utils/exceptions.py
#	aiogram/utils/executor.py
#	aiogram/utils/helper.py
#	aiogram/utils/json.py
#	aiogram/utils/mixins.py
#	aiogram/utils/payload.py
#	dev_requirements.txt
#	docs/source/index.rst
#	examples/callback_data_factory.py
#	examples/check_user_language.py
#	examples/echo_bot.py
#	examples/finite_state_machine_example.py
#	examples/i18n_example.py
#	examples/inline_bot.py
#	examples/media_group.py
#	examples/middleware_and_antiflood.py
#	examples/payments.py
#	examples/proxy_and_emojize.py
#	examples/regexp_commands_filter_example.py
#	examples/throtling_example.py
#	examples/webhook_example.py
#	examples/webhook_example_2.py
#	setup.py
#	tests/test_bot.py
#	tests/test_token.py
#	tests/types/dataset.py
2019-11-03 22:19:44 +02:00
JR Minnaar
1cdfa3e3c2 Fix all occurrences of adwanced in text 2019-09-12 10:33:24 +02:00
Rossouw Minnaar
a74efa311e Fix spelling 2019-09-09 11:13:42 +02:00
birdi
ed0d4796e7 Merge branch 'dev-2.x' into add-new-ways-throttle
# Conflicts:
#	examples/throtling_example.py
2019-08-15 17:06:10 +03:00
Alex Root Junior
23ceb1445e
Merge branch 'dev-2.x' into dev-2.x 2019-08-15 16:52:51 +03:00
Suren Khorenyan
58a5da925a Refactor examples/webhook_example.py 2019-08-11 22:52:54 +03:00
Suren Khorenyan
251760a032 Rename webhook example 2019-08-11 22:51:50 +03:00
Suren Khorenyan
fdf3c44860 Rename old webhook example 2019-08-11 22:50:58 +03:00
Suren Khorenyan
94811c57e1 Minor refactor examples/text_filter_example.py and examples/throtling_example.py 2019-08-11 22:02:36 +03:00
Suren Khorenyan
8538e6af57 Refactor examples/regular_keyboard_example.py 2019-08-11 21:52:58 +03:00
Suren Khorenyan
747c87631e Refactor examples/regexp_commands_filter_example.py 2019-08-11 16:31:01 +03:00
Suren Khorenyan
a93fb46382 Refactor examples/proxy_and_emojize.py 2019-08-11 15:49:27 +03:00
Suren Khorenyan
68aa7dbf1a Refactor examples/payments.py 2019-08-11 15:30:01 +03:00
Suren Khorenyan
95fcaaeed7 Micro refactor 2019-08-10 22:09:29 +03:00
Suren Khorenyan
7a155794e2 Refactor examples/inline_keyboard_example.py 2019-08-10 21:55:52 +03:00
Suren Khorenyan
c6871f8071 Refactor examples/inline_bot.py 2019-08-10 20:17:03 +03:00
Suren Khorenyan
a4f8dc907a Refactor examples/id_filter_example.py 2019-08-10 18:41:50 +03:00
Suren Khorenyan
a78b93c5cd Refactor examples/i18n_example.py 2019-08-10 17:55:39 +03:00
Suren Khorenyan
d360538bba Some localization changes 2019-08-10 00:08:11 +03:00
Suren Khorenyan
ad7238fda8 Some refactor 2019-08-10 00:08:11 +03:00