nostr-gem/docs/events/set-metadata.md
2023-11-13 17:48:17 +07:00

604 B

Set Metadata

In the Metadata event, the content is set to a stringified JSON object {name: <username>, about: <string>, picture: <url, string>} describing the user who created the event. A relay may delete older events once it gets a new one for the same pubkey.

Setting the user's metadata

metadata_event = user.create_event(
  kind: Nostr::EventKind::SET_METADATA,
  content: {
    name: 'Wilson Silva',
    about: 'Used to make hydrochloric acid bombs in high school.',
    picture: 'https://thispersondoesnotexist.com/'
  }
)

client.publish(metadata_event)