feat(telegram): 优化Telegram文件下载与base64转换逻辑,重构消息发送相关代码

- 新增 TelegramModule.download_file_to_base64 方法,统一文件下载与base64编码
- Telegram 客户端新增 download_file 方法,简化文件下载流程
- 消息图片下载逻辑调整为通过模块方法调用,移除冗余静态方法
- 修复部分参数格式与空格风格,提升代码一致性
- 优化长消息发送异常处理与代码结构
This commit is contained in:
jxxghp
2026-03-30 10:28:40 +08:00
parent 70109635c7
commit 9c51f73a72
4 changed files with 131 additions and 122 deletions

View File

@@ -251,7 +251,7 @@ class MoviePilotAgent:
if start_idx > 0:
on_token(buffer[:start_idx])
in_think_tag = True
buffer = buffer[start_idx + 7 :]
buffer = buffer[start_idx + 7:]
else:
# 检查是否以 <think> 的前缀结尾
partial_match = False
@@ -269,7 +269,7 @@ class MoviePilotAgent:
end_idx = buffer.find("</think>")
if end_idx != -1:
in_think_tag = False
buffer = buffer[end_idx + 8 :]
buffer = buffer[end_idx + 8:]
else:
# 检查是否以 </think> 的前缀结尾
partial_match = False