From 998777d46a0dbe679eaf7a7bf7f5ed89ea99c652 Mon Sep 17 00:00:00 2001 From: syui Date: Wed, 22 Jan 2025 17:54:42 +0900 Subject: [PATCH] test game --- .config/ai/scpt | 2 +- src/bot.rs | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.config/ai/scpt b/.config/ai/scpt index e55225e..7a4d642 160000 --- a/.config/ai/scpt +++ b/.config/ai/scpt @@ -1 +1 @@ -Subproject commit e55225eb57a05f38ccc7be58ce6b00279f4d636c +Subproject commit 7a4d642e418bbe43d1b5cfaa8cf7ead45363e5dd diff --git a/src/bot.rs b/src/bot.rs index 27a40c9..9d2d9e5 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -431,6 +431,42 @@ pub fn c_bot(c: &Context) { println!("{}", str_rep); w_cid(cid.to_string(), log_file(&"n1"), true); } + } else if com == "game" || com == "/game" { + let output = Command::new(data_scpt(&"ai")) + .arg(&"atproto").arg(&"game") + .arg(&handle) + .arg(&did) + .arg(&cid) + .arg(&uri) + .arg(&cid_root) + .arg(&uri_root) + .arg(&host) + .arg(&prompt) + .arg(&prompt_sub) + .output() + .expect("zsh"); + let d = String::from_utf8_lossy(&output.stdout); + let dd = "\n".to_owned() + &d.to_string(); + let text_limit = c_char(dd); + handlev = d.lines().collect::>()[0].to_string(); + link = "https://card.syui.ai/".to_owned() + &handlev; + println!("{}", e); + e = link.chars().count(); + if text_limit.len() > 3 { + 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 == "quiz" || com == "/quiz" { println!("admin:{}", admin); let output = Command::new(data_scpt(&"ai"))