1
0
bot/docs/wiki.md

167 lines
4.5 KiB
Markdown
Raw Normal View History

2024-03-28 19:11:58 +00:00
## test-notify
2024-03-21 15:32:23 +00:00
```sh
./target/debug/ai n|jq -r ".notifications|.[].cid" >> ~/.config/ai/txt/notify_cid*
./target/debug/ai bot
```
2024-03-28 19:11:58 +00:00
## docker
2023-10-20 14:31:16 +00:00
```sh
$ docker run -it syui/aios ai
$ docker run -it -d syui/aios zsh -c "ai login <handle> -p <password> && ai bot"
```
```sh
$ cp -rf ~/.config/ai ./.config/
$ docker compose up
```
2024-03-28 19:11:58 +00:00
## cron
2023-10-20 14:31:16 +00:00
```sh
$ sudo pacman -S fcron
$ fcrontab -e
* * * * * $HOME/bot/test/ai.zsh c
```
2024-03-28 19:11:58 +00:00
## ssh
2023-10-20 14:31:16 +00:00
```sh
$ ssh-keygen -f /.ssh/diffusers.key -t ed25519
```
```sh
FROM syui/aios
ADD .ssh /root/.ssh
```
```sh
Host diffusers
HostName localhost
User root
IdentityFile ~/.ssh/diffusers.key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
```
```sh
services:
aios:
#image: syui/aios
build:
context: .
restart: always
volumes:
- ./.config:/root/.config
command: ai bot -a syui.syu.is
```
2024-03-10 04:43:46 +00:00
2024-03-28 19:11:58 +00:00
## openapi
2024-03-10 04:43:46 +00:00
```sh
# https://github.com/rdmurphy/atproto-openapi-types
$ curl -sLO https://raw.githubusercontent.com/rdmurphy/atproto-openapi-types/main/spec/api.json
```
2024-03-28 19:11:58 +00:00
## plc
```sh
# 何度か実行するとplcをlatestまでexportされる
$ .config/ai/scpt/test/pds.zsh e
```
2024-04-02 08:07:18 +00:00
## manga
2024-04-02 08:50:34 +00:00
```sh
$ ai bot --manga_uri at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.feed.post/3kp4zdnlo5s2j
```
2024-04-02 08:07:18 +00:00
```json
[
{
"uri": "at://did:plc:wkzuqomvkxx5eiv5nl2lvm23/app.bsky.feed.post/3kp4ze5dcek2j",
"cid": "bafyreic4g7mthhw654zgv4skt5tqbs2xqg6n7bli4gayl2nquljngnotiy",
"author": {
"did": "did:plc:wkzuqomvkxx5eiv5nl2lvm23",
"handle": "syui.syu.is",
"displayName": "syui",
"avatar": "https://api.syu.is/img/avatar/plain/did:plc:wkzuqomvkxx5eiv5nl2lvm23/bafkreifvabvstfgawt6csagh44xdevb6c2uiwpgfho3xnpdrr6o7nbkxry@jpeg",
"indexedAt": "2024-01-14T10:20:13.367Z",
"viewer": {
"muted": false,
"blockedBy": false,
"following": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.graph.follow/3kiztjatnms25",
"followedBy": "at://did:plc:wkzuqomvkxx5eiv5nl2lvm23/app.bsky.graph.follow/3kirwsboeos26"
},
"labels": []
},
"reason": "reply",
"reasonSubject": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.feed.post/3kp4zdnlo5s2j",
"record": {
"text": "1",
"$type": "app.bsky.feed.post",
"langs": [
"ja"
],
"reply": {
"root": {
"cid": "bafyreiceckunxajycacn7dbuojrwb2wmurhfkleermvewwik44cn6vqo3a",
"uri": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.feed.post/3kp4zdnlo5s2j"
},
"parent": {
"cid": "bafyreiceckunxajycacn7dbuojrwb2wmurhfkleermvewwik44cn6vqo3a",
"uri": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.feed.post/3kp4zdnlo5s2j"
}
},
"createdAt": "2024-04-02T07:12:28.799Z"
},
"isRead": true,
"indexedAt": "2024-04-02T07:12:28.799Z",
"labels": []
},
{
"uri": "at://did:plc:wkzuqomvkxx5eiv5nl2lvm23/app.bsky.feed.post/3kp54af2zes2j",
"cid": "bafyreig4kvfpu557qehttt2y5eh7rcyodbxqwtnl73f3fhjsstiap3abzu",
"author": {
"did": "did:plc:wkzuqomvkxx5eiv5nl2lvm23",
"handle": "syui.syu.is",
"displayName": "syui",
"avatar": "https://api.syu.is/img/avatar/plain/did:plc:wkzuqomvkxx5eiv5nl2lvm23/bafkreifvabvstfgawt6csagh44xdevb6c2uiwpgfho3xnpdrr6o7nbkxry@jpeg",
"indexedAt": "2024-01-14T10:20:13.367Z",
"viewer": {
"muted": false,
"blockedBy": false,
"following": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.graph.follow/3kiztjatnms25",
"followedBy": "at://did:plc:wkzuqomvkxx5eiv5nl2lvm23/app.bsky.graph.follow/3kirwsboeos26"
},
"labels": []
},
"reason": "reply",
"reasonSubject": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.feed.post/3kp4zdnlo5s2j",
"record": {
"text": "2",
"$type": "app.bsky.feed.post",
"langs": [
"ja"
],
"reply": {
"root": {
"cid": "bafyreiceckunxajycacn7dbuojrwb2wmurhfkleermvewwik44cn6vqo3a",
"uri": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.feed.post/3kp4zdnlo5s2j"
},
"parent": {
"cid": "bafyreiceckunxajycacn7dbuojrwb2wmurhfkleermvewwik44cn6vqo3a",
"uri": "at://did:plc:dconvttcori3mrh2wrmehvwt/app.bsky.feed.post/3kp4zdnlo5s2j"
}
},
"createdAt": "2024-04-02T08:04:03.938Z"
},
"isRead": true,
"indexedAt": "2024-04-02T08:04:03.938Z",
"labels": []
}
]
```