Bump version, small changes in docs

This commit is contained in:
Alex Root Junior 2021-12-12 18:59:57 +02:00
parent 2620a6547c
commit 1634dc1162
14 changed files with 67 additions and 31 deletions

View file

@ -14,6 +14,54 @@ Changelog
.. 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)
======================

View file

@ -1 +0,0 @@
Fixed: Missing :code:`ChatMemberHandler` import in :code:`aiogram/dispatcher/handler`

View file

@ -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)))

View file

@ -1 +0,0 @@
Check :code:`destiny` in case of no :code:`with_destiny` enabled in RedisStorage key builder

View file

@ -1 +0,0 @@
Added full support of `Bot API 5.5 <https://core.telegram.org/bots/api-changelog#december-7-2021>`_

View file

@ -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.

View file

@ -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.

View file

@ -1,6 +1,6 @@
#######
aiogram
#######
####################
aiogram |beta badge|
####################
.. danger::
This version still in development!
@ -78,3 +78,7 @@ Features
- `English language <https://t.me/aiogram>`_
- `Russian language <https://t.me/aiogram_ru>`_
.. |beta badge| image:: https://img.shields.io/badge/-beta-orange
:alt: Beta badge

View file

@ -36,5 +36,5 @@ __all__ = (
"md",
)
__version__ = "3.0.0a19"
__version__ = "3.0.0b1"
__api_version__ = "5.5"

View file

@ -17,7 +17,7 @@ Usage example
from aiogram.session.aiohttp import AiohttpSession
session = AiohttpSession()
Bot('42:token', session=session)
bot = Bot('42:token', session=session)
Proxy requests in AiohttpSession
@ -33,7 +33,7 @@ Binding session to bot:
from aiogram.client.session.aiohttp import AiohttpSession
session = AiohttpSession(proxy="protocol://host:port/")
Bot(token="bot token", session=session)
bot = Bot(token="bot token", session=session)
.. note::

View file

@ -8,6 +8,7 @@ For example, if you want to use self-hosted API server:
.. code-block:: python3
session = AiohttpSession()
session.api = TelegramAPIServer.from_base('http://localhost:8082')
session = AiohttpSession(
api=TelegramAPIServer.from_base('http://localhost:8082')
)
bot = Bot(..., session=session)

View file

@ -65,10 +65,10 @@ Class-based
.. code-block:: python
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:
self.counter = 0

View file

@ -28,6 +28,8 @@ MAIN_BOT_PATH = "/webhook/main"
OTHER_BOTS_PATH = "/webhook/bot/{bot_token}"
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]]:
try:
@ -45,7 +47,7 @@ async def command_add_bot(message: Message, command: CommandObject, bot: Bot):
except TelegramUnauthorizedError:
return message.answer("Invalid token")
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")

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "aiogram"
version = "3.0.0-alpha.19"
version = "3.0.0-beta.1"
description = "Modern and fully asynchronous framework for Telegram Bot API"
authors = [
"Alex Root Junior <jroot.junior@gmail.com>",