Skip to content

Commit 7e3ce81

Browse files
committed
Fix: typing in changelog command.
1 parent e764121 commit 7e3ce81

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

core/paginator.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)