Commit graph

2042 commits

Author SHA1 Message Date
Alex Root Junior
1f7bbeb355
Added full support of Bot API 7.5 (#1518)
* Added full support of Bot API 7.5

* Added changelog

* Update date type in RevenueWithdrawalStateSucceeded

* Added example
2024-06-19 00:54:22 +03:00
Alex Root Junior
dcfc9632f3
Add DNS cache ttl setting to aiohttp session. (#1514)
* Add DNS cache ttl setting to aiohttp session.
Also the limit argument is added to the session initializer.

This commit adds a setting for DNS cache ttl (time-to-live) to the aiohttp session configuration. This is implemented as a workaround for a known issue in aiogram as exhibited in aiogram/aiogram#1500.

* Added changelog
2024-06-17 02:51:35 +03:00
JRoot Junior
835813ca2e
Update chagenlog 2024-06-17 01:06:48 +03:00
beliboba
f568ef09e8
InputFile reuse recommendations update (#1506)
* Update upload_file.rst

who the fuck even wrote this

* Update docs/api/upload_file.rst

Co-authored-by: Yana Malenko <107151775+akchonya@users.noreply.github.com>

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
Co-authored-by: Yana Malenko <107151775+akchonya@users.noreply.github.com>
2024-06-17 00:57:28 +03:00
Rishat-F
1df3adaba1
Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring (#1510)
* Smaller timeout for MongoStorage connection

By default serverSelectionTimeoutMS=30000. This is too much

* Correct ConnectionError for RedisStorage in tests

* Remove unused import in conftest.py

* Refactor skipping redis and mongo tests

* Fail redis and mongo tests if incorrect URI

If incorrect URIs provided to "--redis" and/or "--mongo" options
tests should fail with ERRORs instead of skipping.
Otherwise the next scenario is possible:
  1) developer breaks RedisStorage and/or MongoStorage code
  2) tests are run with incorrect redis and/or mongo URIs
     provided by "--redis" and "--mongo" options.
     For example, wrong port specified.
  3) tests pass because skipping doesn't fail tests run
  4) developer or reviewer doesn't notice
     that redis and/or mongo tests were skipped
  5) broken code gets in codebase

* Remove unused fixtures passing in storages tests

* Define create_storage_key fixture in conftest.py

* Linters formatting

* Changes description

* Revert "Smaller timeout for MongoStorage connection"

This reverts commit d88b7ec612.

* Smaller timeout for MongoStorage connection in tests

The default 30s timeout is too long

* Add test for MongoStorage for 100% coverage

* Linters formatting

* Move skipping redis/mongo tests in earlier fixtures

* Replace vars with constants in conftest.py

* Linters formatting
2024-06-17 00:55:59 +03:00
Oleg A
7760ab1d0d
Bump dev dependencies (#1512)
* Bump dev dependencies

* Pre-commit py3.8 support

* Pre-commit py3.8 support (v3.5+)

* Mute mypy python version bug
2024-06-14 20:11:08 +03:00
Oleg A
0df95a0276
Apply isort (#1508) 2024-06-11 03:08:08 +03:00
Oleg A
69c359d23a
Add Dependencies to migrations guide (#1504)
* Add Dependencies to migrations guide

* Added changelog
2024-06-07 18:52:02 +03:00
JRoot Junior
0335bb14fc
Small changes in the changelog 2024-06-01 02:29:17 +03:00
JRoot Junior
9bab51c908
Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x 2024-06-01 01:58:41 +03:00
JRoot Junior
b64587d4a7
Bump version 2024-06-01 01:58:32 +03:00
Alex Root Junior
afd1e6da74
Added MongoDB dependency to ReadTheDocs configuration (#1502)
* Add MongoDB dependency to ReadTheDocs configuration

An update has been made to the ReadTheDocs configuration file to include MongoDB as an additional dependency on installation. This change addresses issues with the MongoStorage section in the documentation.

* Rename changelog file
2024-06-01 01:56:38 +03:00
JRoot Junior
0c2ef663da
Fixed version number in changelog 2024-05-31 21:01:55 +03:00
JRoot Junior
e224bb162d
Bump changelog and API version 2024-05-31 20:22:51 +03:00
sdmway
e3dc7d576b
misc: code consistency and bot instance creation (#1482)
* misc: code consistency and bot instance creation

* Changelog for aiogram#1482

* misc: consistency of comments and dispatcher instance creation

* misc: removed routers example

* Update CHANGES/1482.misc.rst

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2024-05-31 20:11:21 +03:00
Alex Root Junior
b08ba78898
Added full support of Bot API 7.4 (#1498)
* Added full support of Bot API 7.4

* Added changelog
2024-05-31 20:07:11 +03:00
Alexey Berezin
f50e058725
Fixed bug with wrong MarkdownV2 custom emoji parsing (#1497)
* fixed bug with wrong markdownv2 custom emoji parsing

* added changelog of 1496 issue

* Update CHANGES/1496.bugfix.rst

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2024-05-30 20:58:51 +03:00
Alex Root Junior
b5d94f17b5
Removed deprecated arguments from Bot class (#1494)
* Remove deprecated attributes from Bot class

The deprecated attributes `parse_mode`, `disable_web_page_preview`, and `protect_content` have been removed from the Bot class. Additionally, the associated warnings and test cases have been deleted. These attributes should now be passed using the `default=DefaultBotProperties(...)` syntax instead.

* Added docs and changelog
2024-05-27 14:58:39 +03:00
JRoot Junior
895f4f8dce
Reformat code 2024-05-11 01:57:24 +03:00
JRoot Junior
972eeafce5
#1485 Fixed slots on MagicData filter 2024-05-11 01:57:16 +03:00
JRoot Junior
a7d3e9a720
Bump version 2024-05-07 22:43:07 +03:00
Rishat-F
1ef7655fd7
Added MongoStorage for FSM (#1434)
* Mongo storage included to storages test

* Added few additional checks in storages test

* Added MongoStorage for FSM

* Added changes description

* Fixed error message syntax

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

* Resolved mypy check error

* IF/ELSE statement simplified

* Fix ruff linter error: RET505 Unnecessary `elif` after `return` statement

* Fix ruff linter error: E501 Line too long (100 > 99)

* Added mongo storage testing in CI

* Refactoring while review

* Refactoring while review

* Storing FSM state and data together in MongoDB-storage

* Fix CI - MongoDB container action is only supported on Linux

* Refactoring while review

* Enable Macos in pypy-tests section of CI

* Refactoring while review

* Makefile updated

* redis and mongo storages tests do not run in pypy-tests job of CI

* Fix docstring of DefaultKeyBuilder

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2024-05-07 22:42:31 +03:00
JRoot Junior
25c76b7d74
Bump docs 2024-05-07 00:02:31 +03:00
DaniilKosvintsev
f45863a0b9
Added message serialisation and deserialization block in 2.x -> 3.x migration guide (#1479)
* Added message serialisation and deserialization block in 2.x -> 3.x migration guide

* fixed docs, added to_python() pydantic alternative

* fixed docs, added examples

---------

Co-authored-by: DanZ-ix <vpupkin@company.com>
2024-05-06 23:28:38 +03:00
Alex Root Junior
cf2980a9c1
Full support of Bot API 7.3 (#1480)
* Added full support of Bot API

* Added full support of Bot API

* Fixed tests

* Added changelog

* Bump version
2024-05-06 23:27:54 +03:00
sdmway
6d655330af
docs: Correct a typo error (#1473) 2024-04-30 23:35:56 +03:00
Alexey Leshchenko
849482da1f
Update command.rst (#1470)
Fix rendition of the backslash in regular expressions
2024-04-24 22:38:26 +03:00
JRoot Junior
6ad287c329
Bump changelog 2024-04-24 22:14:34 +03:00
unintended
f1c9fc50f0
Fix missing error logging (#1458)
* Fix missing error logging 

No error logging when handle_in_background=True

* add CHANGES
2024-04-23 13:59:13 +03:00
Alex Root Junior
4729978c60
Add context manager support for bot client (#1468)
* Add context manager support for bot client

The bot client now supports the context manager protocol, providing automatic resource management. This enhancement helps to automatically close the session when leaving the context, which cleans up resources better. The documentation and tests have been updated accordingly to illustrate this new feature. Moreover, an example of usage without a dispatcher has been provided to clarify its use in simple cases.

* Added changelog
2024-04-22 23:42:47 +03:00
Joren Hammudoglu
9756dac877
loosened pydantic upper bound to <2.8 (#1460)
* bump pydantic to 2.8

* add changelog entry for #1460
2024-04-22 13:49:34 +03:00
Alex Root Junior
057478621b
Added full support of Bot API 7.2 (#1444)
* Added base support of Bot API 7.2

* Added base support of Bot API 7.2

* Fixing tests and content types for Telegram Bot API 7.2 update (#1453)

* Fixing tests and content types for Telegram Bot API 7.2

* Adding changelog for 1453 PR

* Fixes + coverage

* Replace `BusinessConnection.date` type

* Reformat code

* Refactor UserContextMiddleware to use EventContext class

This update significantly refactors UserContextMiddleware to leverage a new class, EventContext. Instead of resolving event context as a tuple, it now produces an instance of EventContext. Additional adjustments include supporting a business connection ID for event context identification and facilitating backwards compatibility. Tests and other files were also updated accordingly for these changes.

* Cover FSM key builder (business_connection_id

* Added changelog

---------

Co-authored-by: RoLOQ <roman.fedunn@gmail.com>
2024-04-22 13:48:49 +03:00
Oleg A
5f157beb26
Bump actions versions (#1459)
* chore: bump actions versions

* chore: add pypy310
2024-04-17 14:09:19 +03:00
Yana Malenko
b49939aaff
add default bot properties and clean imports (#1447) 2024-04-09 01:27:29 +03:00
avoidaway
acf52f468c
chore: remove repetitive words (#1438)
Signed-off-by: avoidaway <cmoman@126.com>
2024-03-17 02:20:29 +02:00
Maxim
506dacc0ff
Added message_thread_id parameter to ChatActionSender class methods (#1437)
* Added message_thread_id parameter to ChatActionSender class methods

* Added changelog

* rename chagelog file
2024-03-11 21:53:17 +02:00
Alex Root Junior
0c9eeda8a7
Fixed poll answer FSM context (#1436)
* Add voter_chat to poll_answer event handling

The change ensures that when a poll_answer event is processed, the user context middleware now also returns the chat where the vote took place. Previously, only the user who cast the vote was returned.

* Added changelog

* Fixed tests

* Bump Python version in test
2024-03-10 16:18:41 +02:00
JRoot Junior
30cee817f4
Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x 2024-03-09 00:40:59 +02:00
JRoot Junior
bc08d90ce5
More tests for defaults 2024-03-09 00:40:46 +02:00
JRoot Junior
ee71117807
Bump pydantic version 2024-03-09 00:38:37 +02:00
Leroy-bit
a2e75e5345
doc updated for WebApp (#1433)
Added WebAppChat class to WebApp docs, updated uk_UA localisation of WebApp docs.
2024-03-06 01:37:37 +02:00
Kostiantyn Kriuchkov
a585fb08de
Add missing Telegram WebApp API classes and fields (#1424) (#1425)
* Add missing Telegram WebApp API classes and fields (#1424)

* Implemented `WebAppChat` class with fields `id`, `type`, `title`, `username`, and `photo_url` as per Telegram documentation.
* Modified `WebAppUser` class by adding `is_premium`, `added_to_attachment_menu`, and `allows_write_to_pm` fields.
* Modified `WebAppInitData` class to include `chat`, `chat_type`, `chat_instance` fields for full API support.

* fix changelog file name

* fix line too long
2024-02-26 02:13:32 +02:00
JRoot Junior
a37deff396
Fixed typo in the changelog 2024-02-17 10:46:50 +02:00
JRoot Junior
27dddff7f5
Update changelog + version 2024-02-17 10:21:41 +02:00
Alex Root Junior
53849b01a7
Fixed default LinkPreviewOptions JSON serialization (#1419)
* Fixed default link preview options serialization

* Added changelog
2024-02-17 10:10:50 +02:00
JRoot Junior
eef50a2edb
Bump API version in the docs 2024-02-16 23:48:54 +02:00
JRoot Junior
eaa56623ff
Render changelog 2024-02-16 23:47:06 +02:00
Alex Root Junior
75323ac8c3
Added full support of Bot API 7.1 (#1417)
* Added full support of Bot API 7.1

* Added changelog
2024-02-16 23:44:35 +02:00
JRoot Junior
e5176b4434
Update docs translation files 2024-02-16 01:17:09 +02:00
JRoot Junior
18b32f065d
Update changelog 2024-02-16 01:15:12 +02:00