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

View Source

Public Chats List (Kind 10005)

A list of NIP-28 chat channels the user is in. Contains references to channel definition events (kind:40) via e tags.

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

Summary

Functions

Creates a new public chats list (kind 10005).

Parses a kind 10005 event into a PublicChats struct.

Types

t()

@type t() :: %Nostr.Event.PublicChats{channels: [binary()], event: Nostr.Event.t()}

Functions

create(channel_ids, opts \\ [])

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

Creates a new public chats list (kind 10005).

Arguments

  • channel_ids - List of channel creation event IDs (kind:40)
  • opts - Optional event arguments (pubkey, created_at)

Example

iex> PublicChats.create(["channel_event_id_1", "channel_event_id_2"])

parse(event)

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

Parses a kind 10005 event into a PublicChats struct.