fix card handle
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 14m19s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 14m19s
This commit is contained in:
parent
54d867e420
commit
0c2b3544ca
@ -1 +1 @@
|
|||||||
Subproject commit dc082b2001fb5f824ab18f62da56090471e777d0
|
Subproject commit 6408d69188d2db30ed0f5560118c86b8342fc3cd
|
@ -1,3 +1,10 @@
|
|||||||
|
### test-notify
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./target/debug/ai n|jq -r ".notifications|.[].cid" >> ~/.config/ai/txt/notify_cid*
|
||||||
|
./target/debug/ai bot
|
||||||
|
```
|
||||||
|
|
||||||
### docker
|
### docker
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
69
src/bot.rs
69
src/bot.rs
@ -192,36 +192,22 @@ pub fn c_bot(c: &Context) {
|
|||||||
let dd = "\n".to_owned() + &d.to_string();
|
let dd = "\n".to_owned() + &d.to_string();
|
||||||
let text_limit = c_char(dd);
|
let text_limit = c_char(dd);
|
||||||
if text_limit.len() > 3 {
|
if text_limit.len() > 3 {
|
||||||
if d.contains("handle") == false {
|
//handlev = handle.replace(".", "-").to_string();
|
||||||
let str_rep = reply_link::post_request(
|
handlev = d.lines().collect::<Vec<_>>()[0].to_string();
|
||||||
text_limit.to_string(),
|
link = "https://card.syui.ai/".to_owned() + &handlev;
|
||||||
link.to_string(),
|
e = link.chars().count();
|
||||||
s,
|
let str_rep = reply_link::post_request(
|
||||||
e.try_into().unwrap(),
|
text_limit.to_string(),
|
||||||
cid.to_string(),
|
link.to_string(),
|
||||||
uri.to_string(),
|
s,
|
||||||
cid_root.to_string(),
|
e.try_into().unwrap(),
|
||||||
uri_root.to_string(),
|
cid.to_string(),
|
||||||
)
|
uri.to_string(),
|
||||||
|
cid_root.to_string(),
|
||||||
|
uri_root.to_string(),
|
||||||
|
)
|
||||||
.await;
|
.await;
|
||||||
println!("{}", str_rep);
|
println!("{}", str_rep);
|
||||||
} else {
|
|
||||||
handlev = handle.replace(".", "-").to_string();
|
|
||||||
link = "https://card.syui.ai/".to_owned() + &handlev;
|
|
||||||
e = link.chars().count();
|
|
||||||
let str_rep = reply_link::post_request(
|
|
||||||
d.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);
|
w_cid(cid.to_string(), log_file(&"n1"), true);
|
||||||
}
|
}
|
||||||
} else if com == "fav" {
|
} else if com == "fav" {
|
||||||
@ -242,8 +228,11 @@ pub fn c_bot(c: &Context) {
|
|||||||
let dd = "\n".to_owned() + &d.to_string();
|
let dd = "\n".to_owned() + &d.to_string();
|
||||||
let text_limit = c_char(dd);
|
let text_limit = c_char(dd);
|
||||||
if text_limit.len() > 3 {
|
if text_limit.len() > 3 {
|
||||||
|
handlev = d.lines().collect::<Vec<_>>()[0].to_string();
|
||||||
|
link = "https://card.syui.ai/".to_owned() + &handlev;
|
||||||
|
e = link.chars().count();
|
||||||
let str_rep = reply_link::post_request(
|
let str_rep = reply_link::post_request(
|
||||||
d.to_string(),
|
text_limit.to_string(),
|
||||||
link.to_string(),
|
link.to_string(),
|
||||||
s,
|
s,
|
||||||
e.try_into().unwrap(),
|
e.try_into().unwrap(),
|
||||||
@ -274,8 +263,11 @@ pub fn c_bot(c: &Context) {
|
|||||||
let dd = "\n".to_owned() + &d.to_string();
|
let dd = "\n".to_owned() + &d.to_string();
|
||||||
let text_limit = c_char(dd);
|
let text_limit = c_char(dd);
|
||||||
if text_limit.len() > 3 {
|
if text_limit.len() > 3 {
|
||||||
|
handlev = d.lines().collect::<Vec<_>>()[0].to_string();
|
||||||
|
link = "https://card.syui.ai/".to_owned() + &handlev;
|
||||||
|
e = link.chars().count();
|
||||||
let str_rep = reply_link::post_request(
|
let str_rep = reply_link::post_request(
|
||||||
d.to_string(),
|
text_limit.to_string(),
|
||||||
link.to_string(),
|
link.to_string(),
|
||||||
s,
|
s,
|
||||||
e.try_into().unwrap(),
|
e.try_into().unwrap(),
|
||||||
@ -333,9 +325,12 @@ pub fn c_bot(c: &Context) {
|
|||||||
.output()
|
.output()
|
||||||
.expect("zsh");
|
.expect("zsh");
|
||||||
let d = String::from_utf8_lossy(&output.stdout);
|
let d = String::from_utf8_lossy(&output.stdout);
|
||||||
let d = "\n".to_owned() + &d.to_string();
|
let dd = "\n".to_owned() + &d.to_string();
|
||||||
let text_limit = c_char(d);
|
let text_limit = c_char(dd);
|
||||||
if text_limit.len() > 3 {
|
if text_limit.len() > 3 {
|
||||||
|
handlev = d.lines().collect::<Vec<_>>()[0].to_string();
|
||||||
|
link = "https://card.syui.ai/".to_owned() + &handlev;
|
||||||
|
e = link.chars().count();
|
||||||
let str_rep = reply_link::post_request(
|
let str_rep = reply_link::post_request(
|
||||||
text_limit.to_string(),
|
text_limit.to_string(),
|
||||||
link.to_string(),
|
link.to_string(),
|
||||||
@ -365,8 +360,12 @@ pub fn c_bot(c: &Context) {
|
|||||||
.output()
|
.output()
|
||||||
.expect("zsh");
|
.expect("zsh");
|
||||||
let d = String::from_utf8_lossy(&output.stdout);
|
let d = String::from_utf8_lossy(&output.stdout);
|
||||||
let d = "\n".to_owned() + &d.to_string();
|
let dd = "\n".to_owned() + &d.to_string();
|
||||||
let text_limit = c_char(d);
|
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 {
|
if text_limit.len() > 3 {
|
||||||
let str_rep = reply_link::post_request(
|
let str_rep = reply_link::post_request(
|
||||||
text_limit.to_string(),
|
text_limit.to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user