From d6777a0c6a2b381ce632776c9b4408892654c051 Mon Sep 17 00:00:00 2001 From: syui Date: Fri, 29 Mar 2024 04:11:58 +0900 Subject: [PATCH] fix sp --- docs/wiki.md | 18 +++++++++++++----- src/bot.rs | 16 ++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/docs/wiki.md b/docs/wiki.md index 99f4806..376f7a3 100644 --- a/docs/wiki.md +++ b/docs/wiki.md @@ -1,11 +1,11 @@ -### test-notify +## test-notify ```sh ./target/debug/ai n|jq -r ".notifications|.[].cid" >> ~/.config/ai/txt/notify_cid* ./target/debug/ai bot ``` -### docker +## docker ```sh $ docker run -it syui/aios ai @@ -18,7 +18,7 @@ $ cp -rf ~/.config/ai ./.config/ $ docker compose up ``` -### cron +## cron ```sh $ sudo pacman -S fcron @@ -26,7 +26,7 @@ $ fcrontab -e * * * * * $HOME/bot/test/ai.zsh c ``` -### ssh +## ssh ```sh $ ssh-keygen -f /.ssh/diffusers.key -t ed25519 @@ -58,9 +58,17 @@ services: command: ai bot -a syui.syu.is ``` -### openapi +## openapi ```sh # https://github.com/rdmurphy/atproto-openapi-types $ curl -sLO https://raw.githubusercontent.com/rdmurphy/atproto-openapi-types/main/spec/api.json ``` + +## plc + +```sh +# 何度か実行するとplcをlatestまでexportされる +$ .config/ai/scpt/test/pds.zsh e +``` + diff --git a/src/bot.rs b/src/bot.rs index 8db84a8..042a64b 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -118,7 +118,7 @@ pub fn c_bot(c: &Context) { w_cid(cid.to_string(), log_file(&"n1"), true); println!("{}", str_rep); } - } else if com == "help" { + } else if com == "help" || com == "/help" { let link = "https://git.syui.ai/ai/bot/wiki/help".to_string(); let s = 0; let e = link.chars().count(); @@ -135,7 +135,7 @@ pub fn c_bot(c: &Context) { .await; w_cid(cid.to_string(), log_file(&"n1"), true); println!("{}", str_rep); - } else if com == "diffusers" { + } else if com == "diffusers" || com == "/diffusers" { let _output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"diffusers") .arg(&handle) @@ -174,7 +174,7 @@ pub fn c_bot(c: &Context) { println!("{}", text_limit); w_cid(cid.to_string(), log_file(&"n1"), true); } - } else if com == "card" { + } else if com == "card" || com == "/card" { let output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"card") .arg(&handle) @@ -210,7 +210,7 @@ pub fn c_bot(c: &Context) { println!("{}", str_rep); w_cid(cid.to_string(), log_file(&"n1"), true); } - } else if com == "fav" { + } else if com == "fav" || com == "/fav" { let output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"fav") .arg(&handle) @@ -245,7 +245,7 @@ pub fn c_bot(c: &Context) { println!("{}", str_rep); w_cid(cid.to_string(), log_file(&"n1"), true); } - } else if com == "egg" { + } else if com == "egg" || com == "/egg" { let output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"egg") .arg(&handle) @@ -280,7 +280,7 @@ pub fn c_bot(c: &Context) { println!("{}", str_rep); w_cid(cid.to_string(), log_file(&"n1"), true); } - } else if com == "nyan" { + } else if com == "nyan" || com == "/nyan" { let output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"nyan") .arg(&handle) @@ -310,7 +310,7 @@ pub fn c_bot(c: &Context) { println!("{}", str_rep); w_cid(cid.to_string(), log_file(&"n1"), true); } - } else if com == "ten" { + } else if com == "ten" || com == "/ten" { let output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"ten") .arg(&handle) @@ -345,7 +345,7 @@ pub fn c_bot(c: &Context) { println!("{}", str_rep); w_cid(cid.to_string(), log_file(&"n1"), true); } - } else if com == "coin" { + } else if com == "coin" || com == "/coin" { let output = Command::new(data_scpt(&"ai")) .arg(&"atproto").arg(&"coin") .arg(&handle)