feat(app): answer registered chat channels in chat

- chatChannels[].answer: wakeWord (default) or everything. Chat uses
  call.chatWakeWords (else the voice wake words) with the shared
  designated-people switches.
- The brain's answer (reply via chat, not spoken) is posted as a Discord
  reply to the message, pinging nobody; failed or empty answers post
  nothing. Bots, channels with sending off and stops are not answered.
- Chat runs beside the voice conversation and never takes its turn.
- Core: send_chat_reply, chat_answer and the ReplyText event; the worker
  client's reply takes via.
- Specs (conversation, discord core) and the roadmap updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-11 22:36:43 +09:00
parent de35573e5f
commit a70ccda37e
11 changed files with 284 additions and 16 deletions

View File

@@ -312,12 +312,13 @@ impl WorkerClient {
/// Ask the brain to answer `user`. With `speak` the answer is spoken under `id` (its audio and
/// `tts_done` come like a TTS request's); it ends as failed when it cannot be sent, the brain gives
/// no answer, or the worker refuses it.
pub fn reply(&self, id: &str, user: u64, text: &str, speak: bool) -> bool {
/// `via`: `voice` or `chat` (the brain's history scope and where the answer is stored).
pub fn reply(&self, id: &str, user: u64, text: &str, via: &str, speak: bool) -> bool {
if speak {
self.inner.state.lock().unwrap().open_tts.insert(id.to_owned());
}
let sent = self.send_json(json!({"type": "reply", "id": id, "user": user.to_string(), "text": text,
"via": "voice", "speak": speak}));
"via": via, "speak": speak}));
if !sent && speak {
self.end_failed(id);
}