Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Add example of how to create a Post on bsky #255

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions bsky-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,36 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
```

### Posts

Create a BlueSky post:

```rust,no_run
use atrium_api::types::string::Datetime;
use bsky_sdk::BskyAgent;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let agent = BskyAgent::builder().build().await?;
agent.login("...", "...").await?;

agent
.create_record(atrium_api::app::bsky::feed::post::RecordData {
created_at: Datetime::now(),
embed: None,
entities: None,
facets: None,
labels: None,
langs: None,
reply: None,
tags: None,
text: "Hello world, from Rust!".to_string(),
})
.await?;
Ok(())
}
```

### RichText

Creating a RichText object from a string:
Expand Down
Loading