{"type":"rich","version":"1.0","title":"Vampiro Doidão wrote","author_name":"Vampiro Doidão (npub1th…nl09n)","author_url":"https://yabu.me/npub1thqhz30d3swgh96jmg0gfmfwd48p9g9jjz0p0efn5snxjhuupc8q5nl09n","provider_name":"njump","provider_url":"https://yabu.me","html":"nostr:nprofile1qqsx3kq3vkgczq9hmfplc28h687py42yvms3zkyxh8nmkvn0vhkyyuspz4mhxue69uhkummnw3ezummcw3ezuer9wchsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qy88wumn8ghj7mn0wvhxcmmv9u0uehfp, I think some imports are missing in the examples, but even after fixing that, it still throws errors. Can you help me?\n\n// Copyright (c) 2022-2023 Yuki Kishimoto\n// Copyright (c) 2023-2024 Rust Nostr Developers\n// Distributed under the MIT software license\n\nuse nostr_sdk::prelude::*;\nuse tracing_subscriber;\nuse rand;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    tracing_subscriber::fmt::init();\n\n    let keys = Keys::parse(\"nsec12kcgs78l06p30jz7z7h3n2x2cy99nw2z6zspjdp7qc206887mwvs95lnkx\")?;\n    let client = Client::builder()\n        .signer(keys.clone())\n        .opts(Options::new().gossip(true))\n        .build();\n\n    println!(\"Bot public key: {}\", keys.public_key().to_bech32()?);\n\n    client.add_relay(\"wss://nostr.oxtr.dev\").await?;\n    client.add_relay(\"wss://relay.damus.io\").await?;\n    client.add_relay(\"wss://nostr.mom\").await?;\n    client.add_relay(\"wss://nostr.wine\").await?;\n    client.add_relay(\"wss://relay.nostr.info\").await?;\n    client.add_relay(\"wss://auth.nostr1.com\").await?;\n\n    client.connect().await;\n\n    let metadata = Metadata::new()\n        .name(\"rust-nostr-bot-example\")\n        .display_name(\"rust-nostr bot example\")\n        .website(Url::parse(\"https://github.com/rust-nostr/nostr\")?);\n    client.set_metadata(\u0026metadata).await?;\n\n    let subscription = Filter::new()\n        .pubkey(keys.public_key())\n        .kind(Kind::GiftWrap)\n        .limit(0); // Limit set to 0 to get only new events! Timestamp::now() CAN'T be used for gift wrap since the timestamps are tweaked!\n\n    client.subscribe(vec![subscription], None).await?;\n\n    client\n        .handle_notifications(|notification| async {\n            if let RelayPoolNotification::Event { event, .. } = notification {\n                if event.kind == Kind::GiftWrap {\n                    match client.unwrap_gift_wrap(\u0026event).await {\n                        Ok(UnwrappedGift { rumor, sender }) =\u003e {\n                            if rumor.kind == Kind::PrivateDirectMessage {\n                                let content: String = match rumor.content.as_str() {\n                                    \"/rand\" =\u003e rand::random::\u003cu16\u003e().to_string(),\n                                    \"/help\" =\u003e help(),\n                                    _ =\u003e String::from(\n                                        \"Invalid command, send /help to see all commands.\",\n                                    ),\n                                };\n\n                                // Send private message\n                                client.send_private_msg(sender, content, []).await?;\n                            }\n                        }\n                        Err(e) =\u003e tracing::error!(\"Impossible to decrypt direct message: {e}\"),\n                    }\n                }\n            }\n            Ok(false) // Set to true to exit from the loop\n        })\n        .await?;\n\n    Ok(())\n}\n\nfn help() -\u003e String {\n    let mut output = String::new();\n    output.push_str(\"Commands:\\n\");\n    output.push_str(\"/rand - Random number\\n\");\n    output.push_str(\"/help - Help\");\n    output\n}\n\nError log:\n\nuser@Debian:~/sjnostr$ cargo run\n   Compiling sjnostr v0.1.0 (/home/user/sjnostr)\nerror[E0422]: cannot find struct, variant or union type `UnwrappedGift` in this scope\n  --\u003e src/main.rs:48:28\n   |\n48 |                         Ok(UnwrappedGift { rumor, sender }) =\u003e {\n   |                            ^^^^^^^^^^^^^ not found in this scope\n\nerror[E0599]: no method named `unwrap_gift_wrap` found for struct `nostr_sdk::Client` in the current scope\n  --\u003e src/main.rs:47:34\n   |\n47 |                     match client.unwrap_gift_wrap(\u0026event).await {\n   |                                  ^^^^^^^^^^^^^^^^ method not found in `Client`\n\nerror[E0599]: no method named `send_private_msg` found for struct `nostr_sdk::Client` in the current scope\n  --\u003e src/main.rs:59:40\n   |\n59 | ...                   client.send_private_msg(sender, content, []).await?;\n   |                              ^^^^^^^^^^^^^^^^ method not found in `Client`\n\nSome errors have detailed explanations: E0422, E0599.\nFor more information about an error, try `rustc --explain E0422`.\nerror: could not compile `sjnostr` (bin \"sjnostr\") due to 3 previous errors\n\n"}
