File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -156,9 +156,20 @@ async def run(self) -> typing.Optional[Message]:
156156 if not self .running :
157157 await self .show_page (self .current )
158158
159- if self .view is not None :
160- await self .view .wait ()
161-
159+ # Don't block command execution while waiting for the View timeout.
160+ # Schedule the wait-and-close sequence in the background so the command
161+ # returns immediately (prevents typing indicator from hanging).
162+ if self .view is not None :
163+
164+ async def _wait_and_close ():
165+ try :
166+ await self .view .wait ()
167+ finally :
168+ await self .close (delete = False )
169+
170+ # Fire and forget
171+ self .ctx .bot .loop .create_task (_wait_and_close ())
172+ else :
162173 await self .close (delete = False )
163174
164175 async def close (
You can’t perform that action at this time.
0 commit comments