From 2e67129a6c3f1115f1394b6f65d64d04ccb9e099 Mon Sep 17 00:00:00 2001 From: super1207 <1875159423@qq.com> Date: Tue, 31 Oct 2023 19:46:06 +0800 Subject: [PATCH] fix file path --- src/kook_onebot.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kook_onebot.rs b/src/kook_onebot.rs index 2e87f90..553cb27 100644 --- a/src/kook_onebot.rs +++ b/src/kook_onebot.rs @@ -422,10 +422,10 @@ impl KookOnebot { base64::engine::general_purpose::PAD), b64_str)?; }else { let file_path; - if cfg!(target_os = "linux") { - file_path = uri.get(7..).ok_or("can't get file_path")?; - } else { + if cfg!(target_os = "windows") { file_path = uri.get(8..).ok_or("can't get file_path")?; + } else { + file_path = uri.get(7..).ok_or("can't get file_path")?; } let path = Path::new(&file_path); file_bin = tokio::fs::read(path).await?;