Refine typing indicator behavior in message handling
- Adjusted the `_keep_typing` method to refresh the typing indicator every 2 seconds instead of 4, improving responsiveness after progress messages. - Updated the `GatewayRunner` to restore the typing indicator after sending progress messages, enhancing user experience during message processing.
This commit is contained in:
parent
488deb04a4
commit
221fb17c5e
2 changed files with 6 additions and 3 deletions
|
|
@ -414,7 +414,9 @@ class GatewayRunner:
|
|||
# Non-blocking check with small timeout
|
||||
msg = progress_queue.get_nowait()
|
||||
await adapter.send(chat_id=source.chat_id, content=msg)
|
||||
await asyncio.sleep(0.5) # Small delay between messages
|
||||
# Restore typing indicator after sending progress message
|
||||
await asyncio.sleep(0.3)
|
||||
await adapter.send_typing(source.chat_id)
|
||||
except queue.Empty:
|
||||
await asyncio.sleep(0.3) # Check again soon
|
||||
except asyncio.CancelledError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue