Commit 22769b2
Changed files (1)
src
src/asr/voice_recognition.py
@@ -147,10 +147,11 @@ async def voice_to_text(
elif length < TEXT_LENGTH: # middle
await client.send_message(to_int(target_chat), final, reply_parameters=reply_parameters)
else: # long
+ caption = ""
if to_telegraph:
html = "\n".join([f"<p>{s}</p>" for s in texts.split("\n")])
if telegraph_url := await publish_telegraph(title=trigger_info["text"] or "语音识别结果", html=html, author=trigger_info["full_name"], url=trigger_info["message_url"]):
- caption = f"\n**⚡️[Telegraph即时预览]({telegraph_url})**"
+ caption = f"**⚡️[Telegraph即时预览]({telegraph_url})**"
with io.BytesIO(texts.encode("utf-8")) as f:
await client.send_document(to_int(target_chat), f, file_name="语音识别结果.txt", caption=caption, reply_parameters=reply_parameters)
await modify_progress(del_status=True, **kwargs)