feat(channel): add typing indicator for Discord
Spawns a repeating task that fires the Discord typing endpoint every 8 seconds while the LLM processes a response. Adds start_typing and stop_typing to the Channel trait with default no-op impls so other channels can opt in later.
This commit is contained in:
parent
a04716d86c
commit
2f78c5e1b7
3 changed files with 116 additions and 22 deletions
|
|
@ -26,4 +26,15 @@ pub trait Channel: Send + Sync {
|
|||
async fn health_check(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
/// Signal that the bot is processing a response (e.g. "typing" indicator).
|
||||
/// Implementations should repeat the indicator as needed for their platform.
|
||||
async fn start_typing(&self, _recipient: &str) -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Stop any active typing indicator.
|
||||
async fn stop_typing(&self, _recipient: &str) -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue