File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1+ from collections .abc import AsyncIterator
12from dataclasses import dataclass
23from typing import cast
34
@@ -122,11 +123,12 @@ def provide_dp(self, storage: BaseStorage) -> Dispatcher:
122123 return dp
123124
124125 @provide (scope = Scope .APP )
125- async def provide_bot (self , secrets : Secrets ) -> Bot :
126+ async def provide_bot (self , secrets : Secrets ) -> AsyncIterator [ Bot ] :
126127 bot = Bot (secrets .bot_token )
127- await ttt_bot (bot )
128128
129- return bot
129+ async with bot :
130+ await ttt_bot (bot )
131+ yield bot
130132
131133 provide_emoji = provide (
132134 PictographsAsEmojis ,
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ def provide_waiting_locations(
236236 scope = Scope .APP ,
237237 )
238238
239- provide__game_log = provide (
239+ provide_game_log = provide (
240240 StructlogGameLog ,
241241 provides = GameLog ,
242242 scope = Scope .REQUEST ,
You can’t perform that action at this time.
0 commit comments