fix(file): 修复机器人对自身文件上传的响应并移除硬编码路径转换
- 在群文件上传通知中,增加对`self_id`的判断,使机器人忽略自身上传文件的事件,防止不必要的响应。 - 移除 `send_api` 与 `send_handler` 中硬编码的WSL路径转换逻辑,以实现更通用的路径处理。 - 增强文件发送逻辑,使其能处理路径数据为字典的情况并检查空路径。
This commit is contained in:
@@ -56,12 +56,6 @@ async def file_to_stream(
|
||||
if not file_name:
|
||||
file_name = Path(file_path).name
|
||||
|
||||
# 临时的WSL路径转换方案
|
||||
if file_path.startswith("E:"):
|
||||
original_path = file_path
|
||||
file_path = "/mnt/e/" + file_path[3:].replace("\\", "/")
|
||||
logger.info(f"WSL路径转换: {original_path} -> {file_path}")
|
||||
|
||||
params = {
|
||||
"file": file_path,
|
||||
"name": file_name,
|
||||
|
||||
Reference in New Issue
Block a user