Commit graph

265 commits

Author SHA1 Message Date
Alex Root Junior
5c3f442866
Reformat code 2022-10-22 01:02:56 +03:00
Danipulok
8b0ca520f3
Add missing Message methods (#1030)
* Add `Message.forward` method

* Add docs

* Add other methods

* Fix

* Add changes

* Fix lints

* Update CHANGES/1030.feature.rst

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2022-10-22 00:29:29 +03:00
Alex Root Junior
01028f10eb
Small fix in translated pages 2022-10-18 02:12:24 +03:00
Alex Root Junior
b0f251a8b8
Combining filters (again) (#1018)
* Added explicit logic filters, added slots to all other filters

* Update translation files

* Update docs
2022-10-03 01:23:22 +03:00
Alex Root Junior
efae83d337
Added more details when server send invalid response 2022-10-02 19:22:12 +03: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
Oleg A
a08c2e750c
Add representation for aiogram exception (#989)
* feat: add repr for aiogram exception

#988

* docs: add changelog

#988

* tests: add representation coverage

#988

* fix: correct test result type

#988
2022-09-11 23:16:47 +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
c1341ba2df
Added support of Bot API 6.2 (#975)
* Added support of Bot API 6.2
* Added changelog
* Update tests
* Update API version
* Update dependencies, pre-commit config
* Added pytest config
2022-08-14 16:32:29 +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
ShiroNoHaga
851f7a2a37
Add class helper ChatAction (#803)
* Add class helper ChatAction

* Change using helper to using enum.Enum

* Add test for class ChatAction

* Use black formatting

* Add pull request description to CHANGES

* Add test coverage

* Use AutoName class for enum values

* Move `AutoName` to separate file

* Move inheritance from `str`

* Fix failing mypy

* Delete old actions

Co-authored-by: Evgen Fil <evgfilim1@yandex.ru>
2022-07-09 23:47:11 +03:00
darksidecat
bc5b26de5f
Add __eq__ and __hash__ methods to State class (#928)
* Fix the ability to copy the state, now copying the state will return the same state.

* reformat

* full implement deepcopy with memo dict, add typehints

* Update aiogram/dispatcher/fsm/state.py

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

* update tests

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

* remove deepcopy in tests

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

* remove deepcopy method

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

* update changes description

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

* update __eq__  method

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

* add typehints, tests

* return False for not equal objects
creating FilterObject use getfullargspec that check State equality with `type` and `object` builtins, raising Error in `__eq__` method of State break this behavior

* return NotImplemented for other types

* use `!=` instead of 'not x == y' in tests

Co-authored-by: Oleg A. <t0rr@mail.ru>
2022-07-08 02:26:49 +03:00
Oleg A
70088cdd65
Add full_name shortcut for Chat (#929)
Added full_name for Chat
2022-06-26 01:50:27 +03:00
Alex Root Junior
b8893c0971
#944 Rename "extract()" to "extract_from()" for entities (#945)
* #944 Rename "extract()" to "extract_from()" for entities
2022-06-26 01:36:45 +03:00
Alex Root Junior
fadb11515e
Remove deprecated methods (#943)
* #941 Removed deprecated methods
2022-06-25 22:47:08 +03:00
Alex Root Junior
247ffbef69
3.x Bot API 6.1 (#937)
Added support of Bot API 6.1
2022-06-25 18:14:29 +03:00
Alex Root Junior
824b43c436
#901 Fixed false-positive coercing of Union types in API methods (#912)
* #901 Fixed false-positive coercing of Union types in API methods

* Added default value for force_reply
2022-05-14 17:27:36 +03:00
Aleksandr
6ad242399b
#905 Added 3 missing content types (#906)
* Added 3 missing content types

* Added tests for 3 missing content types

* More tests

* Added changelog
2022-05-13 23:52:13 +03:00
Alex Root Junior
f2e02e2a7c
#896 Restrict including routers with strings (#897)
* #896 Restrict including routers with strings
* Remove imports util, bump dependencies
2022-04-25 21:24:58 +03:00
Alex Root Junior
4fb77a3a2a
Added possibility to combine filters or invert result (#895)
* Added possibility to combine filters or invert result
2022-04-24 04:19:19 +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
Alex Root Junior
7776cf9cf6
Bot API 5.7 and some new features (#834)
* Update API, added some new features

* Fixed unknown chat_action value

* Separate events from dispatcher messages

* Disabled cache for I18n LazyProxy

* Rework events isolation

* Added chat member status changed filter, update Bot API 5.7, other small changes

* Improve exceptions in chat member status filter

* Fixed tests, covered flags and events isolation modules

* Try to fix flake8 unused type ignore

* Fixed linter error

* Cover chat member updated filter

* Cover chat action sender

* Added docs for chat action util

* Try to fix tests for python <= 3.9

* Fixed headers

* Added docs for flags functionality

* Added docs for chat_member_updated filter

* Added change notes

* Update dependencies and fix mypy checks

* Bump version
2022-02-19 01:45:59 +02:00
darksidecat
1b8e22d90f
Fix: close #822 Fix exception filter (#827)
* fix exceptions filters

* Update CHANGES/827.bugfix

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2022-02-12 01:38:01 +02:00
Daniil Kovalenko
6e39f9fada
Fix unexpected behavior of sequences in StateFilter (#791)
* Fix sequence check behavior in StateFilter

* Add sequence cases to StateFilter tests

* Add the changelog
2021-12-29 03:39:28 +02:00
Alex Root Junior
2620a6547c Rework session DI and files path wrapper 2021-12-12 18:15:36 +02:00
Andrey Tikhonov
1357a7a91b
Check destiny in case of no with_destiny (#776)
* cehck if destiny is default

* Test testiny check

* reformat
2021-12-12 17:54:01 +02:00
Alex Root Junior
9ec689b562
[3.x] Bot API 5.5 (#777)
* Re-generate API, cover changes

* Added patchnotes
2021-12-12 17:21:01 +02:00
Alex Root Junior
d7be55bc58
Extended MagicFilter with aiogram-specific operation (#759)
* Extend MagicFilter with aiogram-specific operation

* Added tests

* Added changes annotation and update docs
2021-11-24 06:00:37 +02:00
darksidecat
19aa498682
Fix resolve filters chain (#736)
* filter resolving don`t need children routers filters

* add patchnote

* Rename 735.bugfix to 736.bugfix

* add tests for routers chains

* delete unused Router.chain property
2021-11-08 23:27:20 +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
9b43a33b7f
Dev 3.x api 5.4 (#744)
* Re-generate API

* Added new modules

* Added handling new event type and approve/decline aliases for ChatJoinRequest

* Fixed code-coverage

* Bump API version

* Added patch-notes
2021-11-08 02:37:37 +02:00
Alex Root Junior
3ad16be507
Implemented handler flags feature (#728)
* Implemented handler flag feature

* Cover tests
2021-10-25 23:37:14 +03:00
darksidecat
42cba8976f
Bound filters resolving rework, filters with default argument (#727)
* bound filters resolving rework, filters with default argument

* bound filters resolving rework, filters with default argument

* Update 727.misc

* clarification of the comment about skipping filter

* fix data transfer from parent to included routers filters

* fix checking containing value in generator

* Update docs/dispatcher/filters/index.rst

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

* Update 727.misc

* reformat

* better iterable types

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2021-10-12 22:29:57 +03:00
Alex Root Junior
7c6cf3c122 Rework FSM storage key 2021-10-11 01:30:19 +03:00
Alex Root Junior
3f2bcbd8d1 Added MagicData filter 2021-10-11 01:27:07 +03:00
Alex Root Junior
7405db2ad3
Enable Python 3.10 for tests (#719)
* Try to test on Python 3.10

* Prevent to YAML type cast

* Bump poetry

* Removed async_lru

* Disable fail-fast on tests

* Fixed typing

* Added patch-notes
2021-10-06 22:49:14 +03:00
darksidecat
99c99cec78
Add middleware for logging outgoing requests (#716)
* add middleware for logging outgoing requests

* add middleware description

* fix RequestMiddlewareType callable signature

* undo `fix`, update signatures in tests

* remove repeating code

* accept proposed changes

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>

* update tests

* add patchnote

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2021-10-06 00:57:26 +03:00
Alex Root Junior
45a1fb2749
Improve filters factory resolve error (#718) 2021-10-06 00:10:46 +03:00
Alex Root Junior
c19cbc6a5f Added html/md_text properties to Message object and refactor I18n context 2021-09-23 23:45:22 +03:00
Alex Root Junior
e4046095d7
Dev 3.x i18n & improvements (#696)
* Added base code and make code improvements
* Auto-exclude coverage for `if TYPE_CHECKING:`
* Fixed current coverage
* Cover I18n module
* Update pipeline
* Fixed annotations
* Added docs
* Move exceptions
* Added tests for KeyboardBuilder and initial docs
* Remove help generator (removed from sources tree, requires rewrite)
* Added patch-notes #698, #699, #700, #701, #702, #703
2021-09-22 00:52:38 +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
Andrey Tikhonov
90b3a99039
iter states in states group (#666)
* iter states in states group

* fix type hint

* remove empty line

* add changes for doc
2021-09-05 23:55:38 +03:00
Alex Root Junior
18a93aab60
Disabled ContentTypesFilter by default (#668)
* Disabled ContentTypesFilter by default

* Rename file

* Update docs
2021-08-20 02:39:03 +03:00
Alex Root Junior
9238533e93
Feature/rework middlewares chain (#664)
* Reworked middlewares chain

* Added description for router name

* Added patch-notes

* Fixed type hints
2021-08-17 00:43:27 +03:00
darksidecat
c1f605c6f5
add aliases for edit/delete reply markup to Message (#662)
* add aliases for edit/delete reply markup to Message

* add towncrier patch note

* add missed towncrier patch note description
2021-08-17 00:11:47 +03:00
darksidecat
04bbc8211c
add stategroup filter (#659) 2021-08-17 00:09:11 +03:00
darksidecat
71eb5fc44e
fix #660 prepare parse mode for input_message_content (#661)
* fix #660 prepare parse mode for input_message_content of InlineQueryResult

* remove redundant get

* black lint

* add towncrier patch note
2021-08-17 00:08:36 +03:00
Oleg A
f2f276b8cf
refactor: remove redundant pytest marks (#654) 2021-08-03 23:40:14 +03:00
Alex Root Junior
c3844bb18f Added detection of API Errors and fixed coverage 2021-08-01 00:34:50 +03:00