Nostr.Event.KindMuteSets (Nostr Lib v0.2.1) (event) (nip51)

View Source

Kind Mute Sets (Kind 30007)

Allows muting pubkeys only for specific event kinds. The d tag MUST be the kind number as a string. This is an addressable event.

For example, you can mute someone's reposts (kind 6) without muting their notes (kind 1).

Defined in NIP 51 https://github.com/nostr-protocol/nips/blob/master/51.md

Summary

Functions

Creates a new kind mute set (kind 30007).

Parses a kind 30007 event into a KindMuteSets struct.

Types

t()

@type t() :: %Nostr.Event.KindMuteSets{
  event: Nostr.Event.t(),
  muted_kind: integer(),
  pubkeys: [binary()]
}

Functions

create(muted_kind, pubkeys, opts \\ [])

@spec create(integer(), [binary()], Keyword.t()) :: t()

Creates a new kind mute set (kind 30007).

Arguments

  • muted_kind - The event kind to mute for these pubkeys (integer)
  • pubkeys - List of pubkeys to mute for this kind
  • opts - Optional event arguments (pubkey, created_at)

Example

# Mute reposts from specific users
KindMuteSets.create(6, ["pubkey1", "pubkey2"])

# Mute reactions from specific users
KindMuteSets.create(7, ["pubkey3"])

parse(event)

@spec parse(Nostr.Event.t()) :: t()

Parses a kind 30007 event into a KindMuteSets struct.