Do you have that code posted somewhere by chance? I would be interested in browsing through it!
If there is interest I guess I could spend some hours to make it a bit more generic and publish the source.
let agent = BskyAgent::builder().build().await?;
agent
.login("username.bsky.social", "X")
.await?;
let rt = RichText::new_with_detect_facets(msg).await?;
let record = RecordData {
text: rt.text,
created_at: atrium_api::types::string::Datetime::now(),
facets: rt.facets,
};
agent.create_record(record).await?;
Works well enough. It's a bit on the lower end of the "abstraction ladder", there might be more user-friendly libraries for doing this even easier now.