Files
easy-nostr/src/nips/nip12.rs

14 lines
416 B
Rust

use nostr_sdk::prelude::*;
/// Creates a filter for Kind 1 posts matching specific hashtags.
///
/// # Arguments
/// * `hashtags` - A list of hashtags to filter for (without the #).
pub fn create_hashtag_filter<S>(hashtags: Vec<S>) -> Filter
where
S: Into<String>,
{
let tags: Vec<String> = hashtags.into_iter().map(|s| s.into()).collect();
Filter::new().kind(Kind::TextNote).hashtags(tags).limit(50)
}