mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Bump version, small changes in docs
This commit is contained in:
parent
2620a6547c
commit
1634dc1162
14 changed files with 67 additions and 31 deletions
48
CHANGES.rst
48
CHANGES.rst
|
|
@ -14,6 +14,54 @@ Changelog
|
||||||
|
|
||||||
.. towncrier release notes start
|
.. towncrier release notes start
|
||||||
|
|
||||||
|
3.0.0b1 (2021-12-12)
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Added new custom operation for MagicFilter named :code:`as_`
|
||||||
|
|
||||||
|
Now you can use it to get magic filter result as handler argument
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from aiogram import F
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
@router.message(F.text.regexp(r"^(\d+)$").as_("digits"))
|
||||||
|
async def any_digits_handler(message: Message, digits: Match[str]):
|
||||||
|
await message.answer(html.quote(str(digits)))
|
||||||
|
|
||||||
|
|
||||||
|
@router.message(F.photo[-1].as_("photo"))
|
||||||
|
async def download_photos_handler(message: Message, photo: PhotoSize, bot: Bot):
|
||||||
|
content = await bot.download(photo)
|
||||||
|
`#759 <https://github.com/aiogram/aiogram/issues/759>`_
|
||||||
|
|
||||||
|
|
||||||
|
Bugfixes
|
||||||
|
--------
|
||||||
|
|
||||||
|
- Fixed: Missing :code:`ChatMemberHandler` import in :code:`aiogram/dispatcher/handler`
|
||||||
|
`#751 <https://github.com/aiogram/aiogram/issues/751>`_
|
||||||
|
|
||||||
|
|
||||||
|
Misc
|
||||||
|
----
|
||||||
|
|
||||||
|
- Check :code:`destiny` in case of no :code:`with_destiny` enabled in RedisStorage key builder
|
||||||
|
`#776 <https://github.com/aiogram/aiogram/issues/776>`_
|
||||||
|
- Added full support of `Bot API 5.5 <https://core.telegram.org/bots/api-changelog#december-7-2021>`_
|
||||||
|
`#777 <https://github.com/aiogram/aiogram/issues/777>`_
|
||||||
|
- Stop using feature from #336. From now settings of client-session should be placed as initializer arguments instead of changing instance attributes.
|
||||||
|
`#778 <https://github.com/aiogram/aiogram/issues/778>`_
|
||||||
|
- Make TelegramAPIServer files wrapper in local mode bi-directional (server-client, client-server)
|
||||||
|
Now you can convert local path to server path and server path to local path.
|
||||||
|
`#779 <https://github.com/aiogram/aiogram/issues/779>`_
|
||||||
|
|
||||||
|
|
||||||
3.0.0a18 (2021-11-10)
|
3.0.0a18 (2021-11-10)
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Fixed: Missing :code:`ChatMemberHandler` import in :code:`aiogram/dispatcher/handler`
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
Added new custom operation for MagicFilter named :code:`as_`
|
|
||||||
|
|
||||||
Now you can use it to get magic filter result as handler argument
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
from aiogram import F
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
@router.message(F.text.regexp(r"^(\d+)$").as_("digits"))
|
|
||||||
async def any_digits_handler(message: Message, digits: Match[str]):
|
|
||||||
await message.answer(html.quote(str(digits)))
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Check :code:`destiny` in case of no :code:`with_destiny` enabled in RedisStorage key builder
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Added full support of `Bot API 5.5 <https://core.telegram.org/bots/api-changelog#december-7-2021>`_
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Stop using feature from #336. From now settings of client-session should be placed as initializer arguments instead of changing instance attributes.
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
Make TelegramAPIServer files wrapper in local mode bi-directional (server-client, client-server)
|
|
||||||
Now you can convert local path to server path and server path to local path.
|
|
||||||
10
README.rst
10
README.rst
|
|
@ -1,6 +1,6 @@
|
||||||
#######
|
####################
|
||||||
aiogram
|
aiogram |beta badge|
|
||||||
#######
|
####################
|
||||||
|
|
||||||
.. danger::
|
.. danger::
|
||||||
This version still in development!
|
This version still in development!
|
||||||
|
|
@ -78,3 +78,7 @@ Features
|
||||||
|
|
||||||
- `English language <https://t.me/aiogram>`_
|
- `English language <https://t.me/aiogram>`_
|
||||||
- `Russian language <https://t.me/aiogram_ru>`_
|
- `Russian language <https://t.me/aiogram_ru>`_
|
||||||
|
|
||||||
|
|
||||||
|
.. |beta badge| image:: https://img.shields.io/badge/-beta-orange
|
||||||
|
:alt: Beta badge
|
||||||
|
|
|
||||||
|
|
@ -36,5 +36,5 @@ __all__ = (
|
||||||
"md",
|
"md",
|
||||||
)
|
)
|
||||||
|
|
||||||
__version__ = "3.0.0a19"
|
__version__ = "3.0.0b1"
|
||||||
__api_version__ = "5.5"
|
__api_version__ = "5.5"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ Usage example
|
||||||
from aiogram.session.aiohttp import AiohttpSession
|
from aiogram.session.aiohttp import AiohttpSession
|
||||||
|
|
||||||
session = AiohttpSession()
|
session = AiohttpSession()
|
||||||
Bot('42:token', session=session)
|
bot = Bot('42:token', session=session)
|
||||||
|
|
||||||
|
|
||||||
Proxy requests in AiohttpSession
|
Proxy requests in AiohttpSession
|
||||||
|
|
@ -33,7 +33,7 @@ Binding session to bot:
|
||||||
from aiogram.client.session.aiohttp import AiohttpSession
|
from aiogram.client.session.aiohttp import AiohttpSession
|
||||||
|
|
||||||
session = AiohttpSession(proxy="protocol://host:port/")
|
session = AiohttpSession(proxy="protocol://host:port/")
|
||||||
Bot(token="bot token", session=session)
|
bot = Bot(token="bot token", session=session)
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ For example, if you want to use self-hosted API server:
|
||||||
|
|
||||||
.. code-block:: python3
|
.. code-block:: python3
|
||||||
|
|
||||||
session = AiohttpSession()
|
session = AiohttpSession(
|
||||||
session.api = TelegramAPIServer.from_base('http://localhost:8082')
|
api=TelegramAPIServer.from_base('http://localhost:8082')
|
||||||
|
)
|
||||||
bot = Bot(..., session=session)
|
bot = Bot(..., session=session)
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,10 @@ Class-based
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
from aiogram import BaseMiddleware
|
from aiogram import BaseMiddleware
|
||||||
from aiogram.api.types import Message
|
from aiogram.types import Message
|
||||||
|
|
||||||
|
|
||||||
class CounterMiddleware(BaseMiddleware[Message]):
|
class CounterMiddleware(BaseMiddleware):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.counter = 0
|
self.counter = 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ MAIN_BOT_PATH = "/webhook/main"
|
||||||
OTHER_BOTS_PATH = "/webhook/bot/{bot_token}"
|
OTHER_BOTS_PATH = "/webhook/bot/{bot_token}"
|
||||||
REDIS_DSN = "redis://127.0.0.1:6479"
|
REDIS_DSN = "redis://127.0.0.1:6479"
|
||||||
|
|
||||||
|
OTHER_BOTS_URL = f"{BASE_URL}{OTHER_BOTS_PATH}"
|
||||||
|
|
||||||
|
|
||||||
def is_bot_token(value: str) -> Union[bool, Dict[str, Any]]:
|
def is_bot_token(value: str) -> Union[bool, Dict[str, Any]]:
|
||||||
try:
|
try:
|
||||||
|
|
@ -45,7 +47,7 @@ async def command_add_bot(message: Message, command: CommandObject, bot: Bot):
|
||||||
except TelegramUnauthorizedError:
|
except TelegramUnauthorizedError:
|
||||||
return message.answer("Invalid token")
|
return message.answer("Invalid token")
|
||||||
await new_bot.delete_webhook(drop_pending_updates=True)
|
await new_bot.delete_webhook(drop_pending_updates=True)
|
||||||
await new_bot.set_webhook(f"{BASE_URL}{OTHER_BOTS_PATH}")
|
await new_bot.set_webhook(OTHER_BOTS_URL.format(bot_token=command.args))
|
||||||
await message.answer(f"Bot @{bot_user.username} successful added")
|
await message.answer(f"Bot @{bot_user.username} successful added")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "aiogram"
|
name = "aiogram"
|
||||||
version = "3.0.0-alpha.19"
|
version = "3.0.0-beta.1"
|
||||||
description = "Modern and fully asynchronous framework for Telegram Bot API"
|
description = "Modern and fully asynchronous framework for Telegram Bot API"
|
||||||
authors = [
|
authors = [
|
||||||
"Alex Root Junior <jroot.junior@gmail.com>",
|
"Alex Root Junior <jroot.junior@gmail.com>",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue