add mitra

This commit is contained in:
2024-02-23 15:23:14 +09:00
parent 6855cc78b4
commit a6fa5c2ef5
2 changed files with 36 additions and 0 deletions

View File

@ -309,6 +309,30 @@ pub fn c_bot(c: &Context) {
.await;
println!("{}", str_rep);
w_cid(cid.to_string(), log_file(&"n1"), true);
} else if { com == "mitractl" || com == "/mitractl" } && handle == &admin {
println!("admin:{}", admin);
let output = Command::new(data_scpt(&"mitractl"))
.arg(&prompt)
.output()
.expect("zsh");
let d = String::from_utf8_lossy(&output.stdout);
let d = "\n".to_owned() + &d.to_string();
let text_limit = c_char(d);
if text_limit.len() > 3 {
let str_rep = reply_link::post_request(
text_limit.to_string(),
"https://m.syu.is".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 {
// openai
let str_openai = openai::post_request(prompt.to_string()).await;