1
0
bot/scpt/reply.zsh
2024-02-08 15:40:54 +09:00

30 lines
718 B
Bash
Executable File

function reply() {
url="https://$host/xrpc/com.atproto.repo.createRecord"
col="app.bsky.feed.post"
json="{
\"repo\": \"$handle\",
\"did\": \"$did\",
\"collection\": \"$col\",
\"record\": {
\"text\": \"$text\",
\"createdAt\": \"$date\",
\"reply\": {
\"root\": {
\"cid\": \"$cid\",
\"uri\": \"$uri\"
},
\"parent\": {
\"cid\": \"$cid_p\",
\"uri\": \"$uri_p\"
}
}
}
}"
echo $json|jq .
url=https://$host/xrpc/com.atproto.repo.createRecord
j=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d "$json" $url`
}