From fd33a989fa608e08696ec26f8d08ba73853c3989 Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 30 Mar 2024 11:57:20 +0900 Subject: [PATCH] fix --- src/bot.rs | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/src/bot.rs b/src/bot.rs index 2c6a7da..afa512e 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -322,29 +322,27 @@ pub fn c_bot(c: &Context) { let d = String::from_utf8_lossy(&output.stdout); let dd = "\n".to_owned() + &d.to_string(); let text_limit = c_char(dd); - if text_limit.len() > 3 { - handlev = d.lines().collect::>()[0].to_string(); - if d.lines().collect::>().len() >= 1 { - ten_p = d.lines().collect::>()[1]; - } - if ten_p != "true" { - link = "https://card.syui.ai/".to_owned() + &handlev; - e = link.chars().count(); - let str_rep = reply_link::post_request( - text_limit.to_string(), - link.to_string(), - s, - e.try_into().unwrap(), - cid.to_string(), - uri.to_string(), - cid_root.to_string(), - uri_root.to_string(), - ) - .await; - println!("{}", str_rep); - } - w_cid(cid.to_string(), log_file(&"n1"), true); + handlev = d.lines().collect::>()[0].to_string(); + if d.lines().collect::>().len() >= 1 { + ten_p = d.lines().collect::>()[1]; } + if ten_p != "true" { + link = "https://card.syui.ai/".to_owned() + &handlev; + e = link.chars().count(); + let str_rep = reply_link::post_request( + text_limit.to_string(), + link.to_string(), + s, + e.try_into().unwrap(), + cid.to_string(), + uri.to_string(), + cid_root.to_string(), + uri_root.to_string(), + ) + .await; + println!("{}", str_rep); + } + w_cid(cid.to_string(), log_file(&"n1"), true); } else if com == "coin" || com == "/coin" { let output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"coin")