Skip to content

Commit

Permalink
update aiogram to 3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bomzheg committed May 25, 2024
1 parent 9c9a866 commit 8e71cfc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ wheel = "^0.38.4"
pyyaml = "^6.0"
python-dateutil = "^2.8.2"
colorlog = "^6.7.0"
aiogram = "3.4.*"
aiogram = "3.5.*"
pydantic = "~2.5"
aiogram_dialog = "2.0.*"
sqlalchemy = { version = "^2.0", extras = ["asyncio"] }
Expand Down
12 changes: 7 additions & 5 deletions shvatka/infrastructure/di/bot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import AsyncIterable

from aiogram import Bot
from aiogram.client.default import DefaultBotProperties
from aiogram.enums import ParseMode
Expand All @@ -11,14 +13,14 @@ class BotProvider(Provider):
scope = Scope.APP

@provide
def get_bot(self, config: BotConfig) -> Bot:
bot = Bot(
async def get_bot(self, config: BotConfig) -> AsyncIterable[Bot]:
async with Bot(
token=config.token,
session=config.create_session(),
default=DefaultBotProperties(
parse_mode=ParseMode.HTML,
allow_sending_without_reply=True,
),
)
setup_jinja(bot)
return bot
) as bot:
setup_jinja(bot)
yield bot

0 comments on commit 8e71cfc

Please sign in to comment.