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