add mitra
This commit is contained in:
parent
6855cc78b4
commit
a6fa5c2ef5
12
.config/ai/scpt/mitractl.zsh
Executable file
12
.config/ai/scpt/mitractl.zsh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
name=mitra-mitra-1
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
generate-invite-code|invite|i|code)
|
||||||
|
docker exec -it $name bash -c "/app/mitractl $1"|grep invite
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
docker exec -it $name bash -c "/app/mitractl $1"|grep invite
|
||||||
|
;;
|
||||||
|
esac
|
24
src/bot.rs
24
src/bot.rs
@ -309,6 +309,30 @@ pub fn c_bot(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 == "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 {
|
} else {
|
||||||
// openai
|
// openai
|
||||||
let str_openai = openai::post_request(prompt.to_string()).await;
|
let str_openai = openai::post_request(prompt.to_string()).await;
|
||||||
|
Loading…
Reference in New Issue
Block a user