Commit graph

284 commits

Author SHA1 Message Date
JRoot Junior
09af2a1c8b
Fixed lines range 2023-11-23 02:27:03 +02:00
JRoot Junior
ead79a1927
Fixed typo 2023-11-23 01:56:26 +02:00
JRoot Junior
423796a445
Added translation for Scenes 2023-11-23 01:28:11 +02:00
Alex Root Junior
3d63bf3b99
PoC Scenes (#1280)
* Base implementation

* Small refactoring + added possibility to specify post-action on handlers

* Move scene properties to config object

* Revise aiogram/scenes with wizard-based design pattern

Modified files in aiogram/scenes to incorporate the Wizard design pattern. Files affected are _marker.py, _registry.py, _wizard.py and __init__.py. The changes introduced a SceneWizard Class and ScenesManager, both of which aid in controlling navigation between different scenes or states. This helps clarifying the codebase, streamline scene transitions and offer more control over the app flow.

* Added example

* Small optimizations

* Replace ValueError with SceneException in scenes. Added error safety in scene resolver.

* str

* Added possibility to reset context on scene entered and to handle callback query in any state

* Remove inline markup in example

* Small changes

* Docs + example

* Small refactoring

* Remove scene inclusion methods from router

The methods for including scenes as sub-routers have been removed from the router.py file. Instead, the SceneRegistry class is now set to register scenes by default upon initializing. This streamlines the scene management process by removing redundant routers and making registration automatic.

* Init tests

* Small fix in tests

* Add support for State instance in the scene

The aiogram FSM scene now allows the use of State instance as an argument, enabling more customization. Modified the 'as_handler' method to receive **kwargs arguments, allowing passing of attributes to the handler. An additional type check has been also added to ensure the 'scene' is either a subclass of Scene or a string.

* Fixed test

* Expand test coverage for test_fsm module

The commit enhances tests for the test_fsm module to improve code reliability. It includes additional unit tests for the ObserverDecorator and ActionContainer classes and introduces new tests for the SceneHandlerWrapper class. This ensures the correct functionality of the decorator methods, the action container execution, and the handler wrapper.

* Reformat code

* Fixed long line in the example

* Skip some tests on PyPy

* Change mock return_value

* Compatibility...

* Compatibility...

* Compatibility...

* Added base changes description

* Scenes Tests (#1369)

* ADD tests for `SceneRegistry`

* ADD tests for `ScenesManager`

* ADD Changelog

* Revert "ADD Changelog"

This reverts commit 6dd9301252.

* Remove `@pytest.mark.asyncio`, Reformat code

* Scenes Tests. Part 2 (#1371)

* ADD tests for `SceneWizard`

* ADD tests for `Scene`

* Refactor ObserverDecorator to use on.message syntax in test_scene.py
Cover `Scene::__init_subclass__::if isinstance(value, ObserverDecorator):`

* Refactor `HistoryManager` in `aiogram/fsm/scene.py`
Removed condition that checked if 'history' is empty before calling 'update_data' in 'Scene'.

* ADD tests for `HistoryManager`

* Small changes in the documentation

* Small changes in the documentation

* Small changes in the documentation

---------

Co-authored-by: Andrew <11490628+andrew000@users.noreply.github.com>
2023-11-23 00:41:21 +02:00
JRoot Junior
9bced29923
Update translation files 2023-11-16 02:34:57 +02:00
JRoot Junior
2f1ae0a686
Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x 2023-11-14 02:54:34 +02:00
JRoot Junior
6153b4f805
#1314 Mention that event can be skipped 2023-11-14 02:53:13 +02:00
Egor
7b30caed53
chore(docs): update middleware.rst (#1353)
* Update middleware.rst

* changes
2023-11-14 02:44:04 +02:00
Alex Root Junior
228a86afdc
Refresh translation files 2023-10-29 02:32:40 +03:00
VasBrd
98771fdf31
Update base.rst (#1340)
* Update base.rst

Typo correction

* Create 1340.doc.rst
2023-10-18 22:00:25 +03:00
Alex Root Junior
a2ed142557
Remove stale texts 2023-10-08 19:15:53 +03:00
Alex Root Junior
d180fd7a46
Update texts, remove dummy translation files 2023-10-08 19:14:12 +03:00
Kostiantyn Kriuchkov
b5ef05c01a
Corrected grammatical errors, improved sentence structures, translation for migration 2.x-3.x (#1302)
* Corrected grammatical errors, improved sentence structures for clarity, added translation to migration_2_to_3.rst

* add changelog

* Update method name in docs for error handling

* Update migration_2_to_3.rst

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

* Update migration_2_to_3.rst

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

* Update migration_2_to_3.rst

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

* Update docs/locale/uk_UA/LC_MESSAGES/api/methods/set_sticker_set_thumb.po

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

* rollback unnecessary change for error attribute

---------

Co-authored-by: Oleg A. <t0rr@mail.ru>
2023-10-01 15:29:18 +03:00
fulsiram
890a57cd15
Fix broken link in message.rst (#1325) 2023-09-29 11:04:42 +03:00
Oleg A
c229cf8c7b
Updated migration guide with API server (#1299)
* docs: updated migration guide with API server

* Update docs/migration_2_to_3.rst

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

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2023-09-11 00:34:02 +03:00
Alex Root Junior
69c2e1282f
Update filtering docs page 2023-09-10 22:42:32 +03:00
Alex Root Junior
28cc2384e8
Fixed typo 2023-09-07 22:44:05 +03:00
Alex Root Junior
5cf8d7b565
Add MediaGroupBuilder for media group construction (#1293)
Implemented a MediaGroupBuilder class in 'aiogram/utils/media_group.py' to help construct media groups. The class supports addition of different media types (audio, photo, video, document) to the media group with a maximum limit of 10 files. The functionality is demonstrated and usage is documented in 'docs/utils/media_group.rst'. Added related test cases in 'tests/test_utils/test_media_group.py'. This is to streamline and simplify the process of media group creation
2023-09-03 00:25:31 +03:00
Alex Root Junior
e1be9dd668
Fix Message.send_copy method for stories (#1287)
* Fix `Message.send_copy` method for stories

Fixed an issue with the `Message.send_copy` method, which was not functioning properly with story-type messages. The `ForwardMessage` logic has been added to the method to enable copying of stories, in addition to other types. Tests and documentation have also been updated to reflect these changes.

* Typo fix
2023-08-28 22:32:11 +03:00
Alex Root Junior
ca4c1b4b95
Small documentation improvements and texts update 2023-08-26 23:18:20 +03:00
Alex Root Junior
678b3cfe7d
Bot API 6.8 (#1276)
* Prepare for Bot API 6.8

* Bump after public release

* Bump version, added changelog
2023-08-18 20:18:05 +03:00
Oleg A
5a14098803
Add contributing support for zsh and win (#1272)
* fix: add support for zsh and win

* docs: add both install commands (win,lin,mac)

* fix: some typos

* docs: update win cmd examples
2023-08-18 12:06:13 +03:00
nullmatawasoradesu
2093b45799
Fixed some typos in documentation (#1268)
* Fixed typo in i18n documentation

* Removed extra param in docstring of TelegramEventObserver's filter method

* Added changelog
2023-08-16 17:23:10 +03:00
nullmatawasoradesu
0cec7d4933
Migration FAQ supplement (Finite State Machine) (#1264)
* Updated Migration FAQ > Finite State Machine

* Fixed typos, added changelog

* Fixed typo x2
2023-08-13 22:41:56 +03:00
Alex Root Junior
ac124f5b08
Fixed structure of DI docs page, included it in toctree 2023-08-13 22:14:33 +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
nullmatawasoradesu
6d6bcd0a9b
Added a few words about skipping pending updates (#1251)
* Added a few words about skipping pending updates

* Added changelog

* Fixed typo
2023-08-07 23:54:05 +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
Alex Root Junior
90654ac0fa
Enhance keyboard utility, improved documentation page. (#1236)
* Enhance keyboard utility, improved documentation for this utility.

Updated the 'aiogram/utils/keyboard.py' file with new methods for integrating buttons and keyboard creation more seamlessly. Added functionality to create buttons from existing markup and attach another builder. This improvement aims to make the keyboard building process more user-friendly and flexible.

* Added changelog

* Cover by tests
2023-08-04 22:36:50 +03:00
Alex Root Junior
11dc7eaa31
Added typehints for init methods of types and methods (#1245)
* Generate init

* Fixed mypy errors

* Bump butcher

* Added changelog
2023-08-04 00:30:27 +03:00
Yarik
d3bec413db
Add currency enum (#1194)
* Add currency enum

* Add change log

* Add butcher file

* Apply enum
2023-08-02 21:44:49 +03:00
Alex Root Junior
2691b2ac96
Small texts update 2023-07-30 18:35:38 +03:00
Alex Root Junior
54134c68fe
Bump texts translation files 2023-07-30 18:32:37 +03:00
Alex Root Junior
faadc80460
Chat join request shortcuts (#1235)
* Add additional API message methods to ChatJoinRequest class

ChatJoinRequest now includes additional message methods including SendAnimation, SendAudio, SendContact, and many more. The changes are useful for sending various types of messages during chat join requests.

* Added changelog
2023-07-30 18:12:06 +03:00
Alex Root Junior
a1513ddb2d
Added shortcuts for ChatMemberUpdate event (#1234)
* Added shortcuts for ChatMemberUpdate event

* Added changelog
2023-07-30 17:29:45 +03:00
Alex Root Junior
72ff444a2c
Update a migration guide 2023-07-30 00:07:42 +03:00
Alex Root Junior
98a03faf77
Added a few words about throttling 2023-07-29 23:06:37 +03:00
Alex Root Junior
56f0d9d220
Migration guide 2.x -> 3.0 (#1143)
* Initial commit for docs cleanup

* Update migration guide

* More docs

* Added changes description

* Small fixes
2023-07-29 22:36:12 +03:00
Alex Root Junior
0ed62bcadf
Removed pydantic base fields from docs 2023-07-16 23:16:43 +03:00
Alex Root Junior
31c11c31e0
Fixed subtypes and union types generation, new enums added (#1213)
* Fixed subtypes and union types generation, new enums added

* Added changes description
2023-07-11 23:39:54 +03:00
Alex Root Junior
c39a803747
Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x 2023-07-04 00:39:15 +03:00
Alex Root Junior
2a143edf56
Hide pydantic service attributes from models 2023-07-04 00:39:02 +03:00
Andrey
3e3e8d3961
Remove patreon from contributing.rst (#1204) 2023-07-03 21:43:22 +03:00
Alex Root Junior
298b4f0e0d
Update texts 2023-07-02 15:12:42 +03:00
Alex Root Junior
5b20f81654
Formatting tools (#1172)
* Added base implementation of formatting utility

* Refactored and added docs

* Added changelog

* Coverage
2023-06-10 20:47:45 +03:00
Alex Root Junior
62a9f0cb6e
Removed Text filter (#1170)
* Removed Text filter

* Added changelog

* Clean docs

* Fixed pytz
2023-04-22 20:21:17 +03:00
Alex Root Junior
1538bc2e2d
Bot API 6.7 (#1168)
* Added 6.7 features

* Update after release

* Added tests

* Added changelog
2023-04-22 18:09:59 +03:00
Daniil
d8a977f357
fix(docs): fix wrong page link in docs (#1154) 2023-04-08 17:54:08 +03:00
Alex Root Junior
f6020476e6
Update schema 2023-03-11 17:43:01 +02:00
Alex Root Junior
6570d0bab1
Bot API 6.6 (#1139)
* Added basic support of Bot API 6.6

* Update descriptions

* Added StickerFormat enum

* Bump version

* Refresh from docs

* Fixed CommandStart

* Fixed files uploading

* Cover new functionality

* Added changelog

* Update texts
2023-03-11 02:17:47 +02:00