@ducci/jarvis 1.0.93 → 1.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -697,7 +697,6 @@ export async function startTelegramChannel(config) {
|
|
|
697
697
|
await sendMessage(api, chatId, displayText, result.sessionId);
|
|
698
698
|
console.log(`[telegram] response sent chat_id=${chatId} slot=${slot} length=${displayText.length}`);
|
|
699
699
|
// TTS: send audio summary if voice is enabled (config.voiceEnabled checked live, updated by /voice toggle)
|
|
700
|
-
await api.sendMessage(chatId, `[TTS debug] voiceEnabled=${config.voiceEnabled} hasKey=${!!config.fishAudioApiKey}`).catch(() => {});
|
|
701
700
|
if (config.voiceEnabled && config.fishAudioApiKey) {
|
|
702
701
|
try {
|
|
703
702
|
// If the response is a raw JSON blob (format_error recovery), extract the actual text
|
|
@@ -709,12 +708,8 @@ export async function startTelegramChannel(config) {
|
|
|
709
708
|
const plain = toPlainText(ttsSource);
|
|
710
709
|
if (plain) {
|
|
711
710
|
const ttsText = await generateTtsSummary(plain, config);
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
await api.sendMessage(chatId, `[TTS debug] summary="${ttsText}" finalLen=${finalTtsText.length}`).catch(() => {});
|
|
715
|
-
if (finalTtsText) {
|
|
716
|
-
const audioBuffer = await textToSpeech(finalTtsText, config);
|
|
717
|
-
await api.sendMessage(chatId, `[TTS debug] audio bytes: ${audioBuffer.length}`).catch(() => {});
|
|
711
|
+
if (ttsText) {
|
|
712
|
+
const audioBuffer = await textToSpeech(ttsText, config);
|
|
718
713
|
await api.sendAudio(chatId, new InputFile(audioBuffer, 'response.mp3'));
|
|
719
714
|
console.log(`[telegram] voice sent chat_id=${chatId} slot=${slot} tts_chars=${ttsText.length}`);
|
|
720
715
|
}
|