1
0

fix
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
syui 2024-04-22 18:53:04 +09:00
parent c7101a16ed
commit 3e3d8dea89
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56

View File

@ -559,11 +559,13 @@ pub fn c_bot_feed(c: &Context) {
let mut prompt = "".to_string(); let mut prompt = "".to_string();
let mut prompt_sub = "".to_string(); let mut prompt_sub = "".to_string();
let mut prompt_chat = "".to_string(); let mut prompt_chat = "".to_string();
let mut prompt_all = "".to_string();
if com == "@ai" || com == "/ai" { if com == "@ai" || com == "/ai" {
prompt_chat = vec[1..].join(" "); prompt_chat = vec[1..].join(" ");
} else { } else {
prompt = vec[1..].join(" "); prompt = vec[1..].join(" ");
prompt_all = vec[0..].join(" ");
if vec.len() > 1 { if vec.len() > 1 {
prompt_sub = vec[2..].join(" "); prompt_sub = vec[2..].join(" ");
} }
@ -658,6 +660,26 @@ pub fn c_bot_feed(c: &Context) {
.output() .output()
.expect("zsh"); .expect("zsh");
w_cid(cid.to_string(), log_file(&"n1"), true); w_cid(cid.to_string(), log_file(&"n1"), true);
} else if prompt_all.contains("アイ") == true
|| prompt_all.contains("うらな") == true
|| prompt_all.contains("") == true
{
if prompt_all.contains("うらな") == true || prompt_all.contains("") == true {
let _output = Command::new(data_scpt(&"ai"))
.arg(&"atproto").arg(&"fortune")
.arg(&handle)
.arg(&did)
.arg(&cid)
.arg(&uri)
.arg(&cid_root)
.arg(&uri_root)
.arg(&host)
.arg(&prompt)
.arg(&prompt_sub)
.output()
.expect("zsh");
}
w_cid(cid.to_string(), log_file(&"n1"), true);
} else if com == "card" || com == "/card" { } else if com == "card" || com == "/card" {
let output = Command::new(data_scpt(&"ai")) let output = Command::new(data_scpt(&"ai"))
.arg(&"atproto").arg(&"card") .arg(&"atproto").arg(&"card")
@ -900,6 +922,34 @@ pub fn c_bot_feed(c: &Context) {
.await; .await;
println!("{}", str_rep); println!("{}", str_rep);
w_cid(cid.to_string(), log_file(&"n1"), true); 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"))
.arg(&"atproto").arg(&"quiz")
.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 d = d.to_string();
let text_limit = c_char(d);
let str_rep = reply::post_request(
text_limit.to_string(),
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 == "mitractl" || com == "/mitractl" } && handle == &admin { } else if { com == "mitractl" || com == "/mitractl" } && handle == &admin {
println!("admin:{}", admin); println!("admin:{}", admin);
let output = Command::new(data_scpt(&"ai")) let output = Command::new(data_scpt(&"ai"))