use crate::{Ctx, docref, exit, output};
pub async fn say(ctx: &Ctx, doc: &str, text: &str, reply_to: Option<i64>) -> anyhow::Result<i32> {
let client = ctx.client()?;
let id = docref::parse(doc)?;
let sent = client.say(&id, text, reply_to).await?;
if ctx.json {
output::json(&sent);
} else {
eprintln!("Sent to {id}");
}
Ok(exit::OK)
}