This commit is contained in:
parent
ccbd0492f3
commit
94446d1569
30
src/bot.rs
30
src/bot.rs
@ -46,6 +46,7 @@ pub fn c_bot(c: &Context) {
|
||||
cid_root = &n[i].record.reply.as_ref().unwrap().root.cid;
|
||||
uri_root = &n[i].record.reply.as_ref().unwrap().root.uri;
|
||||
}
|
||||
let check_cid_comment = w_cid(cid_root.to_string(), log_file(&"c1"), false);
|
||||
|
||||
let mut text = "";
|
||||
if !n[i].record.text.is_none() {
|
||||
@ -423,6 +424,35 @@ pub fn c_bot(c: &Context) {
|
||||
.await;
|
||||
println!("{}", str_rep);
|
||||
w_cid(cid.to_string(), log_file(&"n1"), true);
|
||||
} else if check_cid_comment == true && handle == &admin {
|
||||
println!("admin:{}", admin);
|
||||
let output = Command::new(data_scpt(&"ai"))
|
||||
.arg(&"atproto").arg(&"comment")
|
||||
.arg(&handle)
|
||||
.arg(&did)
|
||||
.arg(&cid)
|
||||
.arg(&uri)
|
||||
.arg(&cid_root)
|
||||
.arg(&uri_root)
|
||||
.arg(&host)
|
||||
.arg(&avatar)
|
||||
.arg(&prompt_chat)
|
||||
.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);
|
||||
w_cid(cid_root.to_string(), log_file(&"c1"), true);
|
||||
} else if { com == "sh" || com == "/sh" } && handle == &admin {
|
||||
println!("admin:{}", admin);
|
||||
let output = Command::new(data_scpt(&"ai"))
|
||||
|
Loading…
Reference in New Issue
Block a user