What is Nostr?
DanConwayDev
npub15qy…yejr
2024-08-28 18:13:06
in reply to nevent1q…x7t9

DanConwayDev on Nostr: Just one: ```rust fn get_first_proposal_event_id() -> Result<nostr::EventId> { // get ...

Just one:
```rust

fn get_first_proposal_event_id() -> Result<nostr::EventId> {
// get proposal id of first
let client = Client::default();
Handle::current().block_on(client.add_relay("ws://localhost:8055"))?;
Handle::current().block_on(client.connect_relay("ws://localhost:8055"))?;
let proposals = Handle::current().block_on(client.get_events_of(
vec![
nostr::Filter::default()
.kind(nostr::Kind::GitPatch)
.custom_tag(
nostr::SingleLetterTag::lowercase(nostr::Alphabet::T),
vec!["root"],
),
],
nostr_sdk::EventSource::relays(Some(Duration::from_millis(1000))),
))?;
Handle::current().block_on(client.disconnect())?;

let proposal_1_id = proposals
.iter()
.find(|e| {
e.tags
.iter()
.any(|t| t.as_vec()[1].eq(&FEATURE_BRANCH_NAME_1))
})
.unwrap()
.id;
Ok(proposal_1_id)
}
```
Author Public Key
npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr