1
0
This commit is contained in:
syui 2024-02-23 17:10:16 +09:00
parent 086b149b69
commit e1d22a10d4
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
2 changed files with 17 additions and 6 deletions

View File

@ -1,12 +1,21 @@
#!/bin/zsh #!/bin/zsh
name=mitra-mitra-1 #repeat 30 docker exec -it mitra-mitra-1 zsh -c "/app/mitractl generate-invite-code" |grep invite >> .config/ai/txt/mitra_invite.txt
case $1 in #name=mitra-mitra-1
generate-invite-code|invite|i|code) #docker exec -it $name bash -c "/app/mitractl generate-invite-code"|grep invite
docker exec -it $name bash -c "/app/mitractl generate-invite-code"|grep invite
f=~/.config/ai/txt/mitra_invite.txt
cat $f|awk "NR==1"
case $OSTYPE in
darwin*)
sed -i "" 1d $f
;;
linux*)
sed -i 1d $f
;; ;;
*) *)
docker exec -it $name bash -c "/app/mitractl $1"|grep invite sed -i 1d $f
;; ;;
esac esac

View File

@ -321,10 +321,12 @@ pub fn c_bot(c: &Context) {
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 d = "\n".to_owned() + &d.to_string();
let text_limit = c_char(d); let text_limit = c_char(d);
link = "https://m.syu.is".to_string();
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(),
"https://m.syu.is".to_string(), link.to_string(),
s, s,
e.try_into().unwrap(), e.try_into().unwrap(),
cid.to_string(), cid.to_string(),