MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / handleTTS

Function handleTTS

outdated/gemini/gemini.ts:1217–1233  ·  view source on GitHub ↗
(msg: Api.Message, args: string[])

Source from the content-addressed store, hash-verified

1215}
1216
1217async function handleTTS(msg: Api.Message, args: string[]): Promise<void> {
1218 const replyMsg = await msg.getReplyMessage();
1219 const { userQuestion, displayQuestion, apiQuestion } = extractQuestionFromArgs(args, replyMsg);
1220
1221 if (!apiQuestion) {
1222 await msg.edit({ text: "❌ 请提供要转换为语音的文本或回复一条有文字内容的消息" });
1223 return;
1224 }
1225
1226 await msg.edit({ text: "🗣️ 生成语音中..." });
1227
1228 try {
1229 await processAudioGeneration(msg, apiQuestion, 'TTS Handler', replyMsg);
1230 } catch (error: any) {
1231 await msg.edit({ text: `❌ 语音生成失败: ${error.message || '未知错误'}` });
1232 }
1233}
1234
1235async function handleQuestionWithAudio(
1236 msg: Api.Message,

Callers 1

handleGeminiRequestFunction · 0.85

Calls 3

extractQuestionFromArgsFunction · 0.85
processAudioGenerationFunction · 0.85
editMethod · 0.45

Tested by

no test coverage detected