1
0
This commit is contained in:
syui 2024-02-26 00:16:16 +09:00
parent d3ef21a67d
commit 2ddc74ed50
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56
4 changed files with 16 additions and 4 deletions

@ -1 +1 @@
Subproject commit 3dc38ce5fae8cf217864545a3b09c71ce5b066de
Subproject commit ef447c49dc905a85c56d44f8b955fd8a780ee7b7

View File

@ -273,6 +273,8 @@ pub fn c_bot(c: &Context) {
.arg(&uri)
.arg(&prompt)
.arg(&prompt_sub)
.arg(&cid_root)
.arg(&uri_root)
.output()
.expect("zsh");
let d = String::from_utf8_lossy(&output.stdout);

View File

@ -140,6 +140,12 @@ fn main() {
Flag::new("cid", FlagType::String)
.alias("c"),
)
.flag(
Flag::new("uri-root", FlagType::String)
)
.flag(
Flag::new("cid-root", FlagType::String)
)
.flag(
Flag::new("link", FlagType::String)
.alias("l"),
@ -569,11 +575,13 @@ fn reply_og(c: &Context) {
let link = c.string_flag("link").unwrap();
let cid = c.string_flag("cid").unwrap();
let uri = c.string_flag("uri").unwrap();
let cid_root = c.string_flag("cid-root").unwrap();
let uri_root = c.string_flag("uri-root").unwrap();
let title = c.string_flag("title").unwrap();
let desc = c.string_flag("description").unwrap();
let img = c.string_flag("img").unwrap();
let h = async {
let str = reply_og::post_request(m, link, cid, uri, img, title, desc);
let str = reply_og::post_request(m, link, cid, uri, cid_root, uri_root, img, title, desc);
println!("{}", str.await);
};
let res = tokio::runtime::Runtime::new().unwrap().block_on(h);

View File

@ -10,6 +10,8 @@ pub async fn post_request(
link: String,
cid: String,
uri: String,
cid_root: String,
uri_root: String,
img: String,
title: String,
description: String,
@ -49,8 +51,8 @@ pub async fn post_request(
},
"reply": {
"root": {
"cid": cid.to_string(),
"uri": uri.to_string()
"cid": cid_root.to_string(),
"uri": uri_root.to_string()
},
"parent": {
"cid": cid.to_string(),