vibego 0.2.51__py3-none-any.whl → 0.2.53__py3-none-any.whl
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.
- bot.py +35 -3
- {vibego-0.2.51.dist-info → vibego-0.2.53.dist-info}/METADATA +1 -1
- {vibego-0.2.51.dist-info → vibego-0.2.53.dist-info}/RECORD +7 -7
- vibego_cli/__init__.py +1 -1
- {vibego-0.2.51.dist-info → vibego-0.2.53.dist-info}/WHEEL +0 -0
- {vibego-0.2.51.dist-info → vibego-0.2.53.dist-info}/entry_points.txt +0 -0
- {vibego-0.2.51.dist-info → vibego-0.2.53.dist-info}/top_level.txt +0 -0
bot.py
CHANGED
|
@@ -7747,21 +7747,53 @@ async def on_start(m: Message):
|
|
|
7747
7747
|
if ENV_ISSUES:
|
|
7748
7748
|
await m.answer(_format_env_issue_message())
|
|
7749
7749
|
|
|
7750
|
-
@router.message(F.text)
|
|
7750
|
+
@router.message(F.text | F.photo | F.document | F.caption)
|
|
7751
7751
|
async def on_text(m: Message):
|
|
7752
|
+
"""
|
|
7753
|
+
处理用户消息:支持纯文本、带图片和文档的消息
|
|
7754
|
+
- 纯文本消息:使用 m.text
|
|
7755
|
+
- 带媒体消息:使用 m.caption,并下载媒体文件
|
|
7756
|
+
"""
|
|
7752
7757
|
# 首次收到消息时自动记录 chat_id 到 state 文件
|
|
7753
7758
|
_auto_record_chat_id(m.chat.id)
|
|
7754
7759
|
|
|
7755
|
-
|
|
7760
|
+
# 提取文本内容(优先使用 caption,用于带媒体的消息)
|
|
7761
|
+
prompt = (m.caption or m.text or "").strip()
|
|
7762
|
+
|
|
7763
|
+
# 如果有媒体文件,使用增强收集函数
|
|
7764
|
+
has_media = m.photo or m.document
|
|
7765
|
+
if media_handler and has_media:
|
|
7766
|
+
try:
|
|
7767
|
+
content, media_files, feedback = await _collect_message_payload_with_media(m, None)
|
|
7768
|
+
# 发送用户反馈(下载成功/失败提示)
|
|
7769
|
+
if feedback:
|
|
7770
|
+
await m.answer(feedback)
|
|
7771
|
+
# 使用包含媒体路径引用的完整内容
|
|
7772
|
+
prompt = content
|
|
7773
|
+
except Exception as e:
|
|
7774
|
+
worker_log.error(
|
|
7775
|
+
"处理媒体文件失败: %s",
|
|
7776
|
+
e,
|
|
7777
|
+
exc_info=True,
|
|
7778
|
+
extra={**_session_extra(), "chat": m.chat.id}
|
|
7779
|
+
)
|
|
7780
|
+
# 降级处理:继续使用文本部分
|
|
7781
|
+
await m.answer(f"⚠️ 媒体文件处理失败,仅使用文本内容:{str(e)}")
|
|
7782
|
+
|
|
7756
7783
|
if not prompt:
|
|
7757
7784
|
return await m.answer("请输入非空提示词")
|
|
7785
|
+
|
|
7786
|
+
# 快捷查询任务详情(如输入 TASK_0001)
|
|
7758
7787
|
task_id_candidate = _normalize_task_id(prompt)
|
|
7759
7788
|
if task_id_candidate:
|
|
7760
7789
|
await _reply_task_detail_message(m, task_id_candidate)
|
|
7761
7790
|
return
|
|
7791
|
+
|
|
7792
|
+
# 忽略以 / 开头的未识别命令
|
|
7762
7793
|
if prompt.startswith("/"):
|
|
7763
7794
|
return
|
|
7764
7795
|
|
|
7796
|
+
# 环境异常检查
|
|
7765
7797
|
if ENV_ISSUES:
|
|
7766
7798
|
message = _format_env_issue_message()
|
|
7767
7799
|
worker_log.warning(
|
|
@@ -7773,7 +7805,7 @@ async def on_text(m: Message):
|
|
|
7773
7805
|
return
|
|
7774
7806
|
|
|
7775
7807
|
bot = current_bot()
|
|
7776
|
-
await bot.send_chat_action(m.chat.id, "typing") #
|
|
7808
|
+
await bot.send_chat_action(m.chat.id, "typing") # "正在输入"提示
|
|
7777
7809
|
|
|
7778
7810
|
if MODE == "A":
|
|
7779
7811
|
if not AGENT_CMD:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bot.py,sha256=
|
|
1
|
+
bot.py,sha256=CesIqaHDsd3Y17WifLCXuVBIzNHM4PNNokdS67HfNFc,288481
|
|
2
2
|
logging_setup.py,sha256=gvxHi8mUwK3IhXJrsGNTDo-DR6ngkyav1X-tvlBF_IE,4613
|
|
3
3
|
master.py,sha256=Jwxf6I94jOADzb9Xio1wb-tWy5wgQ9PlmdpKW4mhQMg,117114
|
|
4
4
|
project_repository.py,sha256=UcthtSGOJK0cTE5bQCneo3xkomRG-kyc1N1QVqxeHIs,17577
|
|
@@ -426,14 +426,14 @@ tasks/constants.py,sha256=tS1kZxBIUm3JJUMHm25XI-KHNUZl5NhbbuzjzL_rF-c,299
|
|
|
426
426
|
tasks/fsm.py,sha256=rKXXLEieQQU4r2z_CZUvn1_70FXiZXBBugF40gpe_tQ,1476
|
|
427
427
|
tasks/models.py,sha256=N_qqRBo9xMSV0vbn4k6bLBXT8C_dp_oTFUxvdx16ZQM,2459
|
|
428
428
|
tasks/service.py,sha256=w_S_aWiVqRXzXEpimLDsuCCCX2lB5uDkff9aKThBw9c,41916
|
|
429
|
-
vibego_cli/__init__.py,sha256=
|
|
429
|
+
vibego_cli/__init__.py,sha256=RhKQDIl5t7O807Y4ZeWjiOuiBu1fCdsMftRxALaJgVM,311
|
|
430
430
|
vibego_cli/__main__.py,sha256=qqTrYmRRLe4361fMzbI3-CqpZ7AhTofIHmfp4ykrrBY,158
|
|
431
431
|
vibego_cli/config.py,sha256=VxkPJMq01tA3h3cOkH-z_tiP7pMgfSGGicRvUnCWkhI,3054
|
|
432
432
|
vibego_cli/deps.py,sha256=1nRXI7Dd-S1hYE8DligzK5fIluQWETRUj4_OKL0DikQ,1419
|
|
433
433
|
vibego_cli/main.py,sha256=X__NXwZnIDIFbdKSTbNyZgZHKcPlN0DQz9sqTI1aQ9E,12158
|
|
434
434
|
vibego_cli/data/worker_requirements.txt,sha256=QSt30DSSSHtfucTFPpc7twk9kLS5rVLNTcvDiagxrZg,62
|
|
435
|
-
vibego-0.2.
|
|
436
|
-
vibego-0.2.
|
|
437
|
-
vibego-0.2.
|
|
438
|
-
vibego-0.2.
|
|
439
|
-
vibego-0.2.
|
|
435
|
+
vibego-0.2.53.dist-info/METADATA,sha256=TnDy-BLDytwFiwIDwpjsFhZEbdk-LAbFIB8GY199oSQ,10519
|
|
436
|
+
vibego-0.2.53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
437
|
+
vibego-0.2.53.dist-info/entry_points.txt,sha256=Lsy_zm-dlyxt8-9DL9blBReIwU2k22c8-kifr46ND1M,48
|
|
438
|
+
vibego-0.2.53.dist-info/top_level.txt,sha256=R56CT3nW5H5v3ce0l3QDN4-C4qxTrNWzRTwrxnkDX4U,69
|
|
439
|
+
vibego-0.2.53.dist-info/RECORD,,
|
vibego_cli/__init__.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|