Compare commits

...

5 Commits

Author SHA1 Message Date
b26fda5155 fix docker
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 11s
2024-08-04 07:53:39 +09:00
ca775dd9c7 test planet
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 15s
2024-08-01 15:16:34 +09:00
ec13092b65 test planet
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
2024-08-01 15:16:23 +09:00
a68b5c9505 fix
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2024-07-25 13:50:36 +09:00
7134c2dd98 fix bot len return
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
2024-05-26 16:45:32 +09:00
3 changed files with 42 additions and 1 deletions

View File

@ -4,5 +4,6 @@ ADD .ssh /root/.ssh
WORKDIR /root WORKDIR /root
ADD ./test/entrypoint.sh . ADD ./test/entrypoint.sh .
RUN chmod +x /root/entrypoint.sh RUN chmod +x /root/entrypoint.sh
RUN pacman -Syu bc --noconfirm
ENTRYPOINT ["/root/entrypoint.sh"] ENTRYPOINT ["/root/entrypoint.sh"]

View File

@ -65,7 +65,11 @@ pub fn c_bot(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();
if reason == "mention" { if reason == "mention" {
if vec.len() == 1 {
return;
}
com = vec[1].trim().to_string(); com = vec[1].trim().to_string();
prompt = vec[2..].join(" "); prompt = vec[2..].join(" ");
prompt_chat = vec[1..].join(" "); prompt_chat = vec[1..].join(" ");
@ -391,6 +395,42 @@ pub fn c_bot(c: &Context) {
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 == "planet" || com == "/planet" {
let output = Command::new(data_scpt(&"ai"))
.arg(&"atproto").arg(&"planet")
.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::<Vec<_>>()[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" { } else if com == "quiz" || com == "/quiz" {
println!("admin:{}", admin); println!("admin:{}", admin);
let output = Command::new(data_scpt(&"ai")) let output = Command::new(data_scpt(&"ai"))