From 0cf1896b5b5d45564d89ae2d5162752e884e5c92 Mon Sep 17 00:00:00 2001 From: CakeCN Date: Wed, 5 Nov 2025 19:00:02 +0800 Subject: [PATCH] paste detecte new --- Html/apps/services/backboard_service.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Html/apps/services/backboard_service.py b/Html/apps/services/backboard_service.py index 7d4cb57..11cbf9a 100644 --- a/Html/apps/services/backboard_service.py +++ b/Html/apps/services/backboard_service.py @@ -57,9 +57,14 @@ def realtime_response(config: dict, realtime_action: dict) -> None: # emit('paste_detected', paste_data) #判断一下,如果粘帖内容过多就发送,后期可加入更多条件判断 - if bb.pasted_content and len(bb.pasted_content) > 250: - chatmanager.ase_client.send("pasted_detected_in", {"file_path": file_path, "content": bb.pasted_content}) - + if bb.pasted_content and len(bb.pasted_content) > 200: + print(f"粘贴内容 : {bb.pasted_content[:100]}...") + print(f"ready to send") + try: + result = chatmanager.ase_client.send_text("pasted_detected_in", bb.pasted_content) + print(f"Send result: {result}") + except Exception as e: + print(f"Error sending: {e}") elif rtype == "fileEdit": file_path = realtime_action.get("filePath")