diff options
| -rw-r--r-- | 30.md | 56 | ||||
| -rw-r--r-- | README.md | 1 |
2 files changed, 57 insertions, 0 deletions
| @@ -0,0 +1,56 @@ | |||
| 1 | NIP-30 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Custom Emoji | ||
| 5 | ------------ | ||
| 6 | |||
| 7 | `draft` `optional` `author:alexgleason` | ||
| 8 | |||
| 9 | Custom emoji may be added to **kind 0** and **kind 1** events by including one or more `"emoji"` tags, in the form: | ||
| 10 | |||
| 11 | ``` | ||
| 12 | ["emoji", <shortcode>, <image-url>] | ||
| 13 | ``` | ||
| 14 | |||
| 15 | Where: | ||
| 16 | |||
| 17 | - `<shortcode>` is a name given for the emoji, which MUST be comprised of only alphanumeric characters. | ||
| 18 | - `<image-url>` is a URL to the corresponding image file of the emoji. | ||
| 19 | |||
| 20 | For each emoji tag, clients should parse emoji shortcodes (aka "emojify") like `:shortcode:` in the event to display custom emoji. | ||
| 21 | |||
| 22 | Clients may allow users to add custom emoji to an event by including `:shortcode:` identifier in the event, and adding the relevant `"emoji"` tags. | ||
| 23 | |||
| 24 | ### Kind 0 events | ||
| 25 | |||
| 26 | In kind 0 events, the `name` and `about` fields should be emojified. | ||
| 27 | |||
| 28 | ```json | ||
| 29 | { | ||
| 30 | "kind": 0, | ||
| 31 | "content": "{\"name\":\"Alex Gleason :soapbox:\"}", | ||
| 32 | "tags": [ | ||
| 33 | ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"] | ||
| 34 | ], | ||
| 35 | "pubkey": "79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6", | ||
| 36 | "created_at": 1682790000 | ||
| 37 | } | ||
| 38 | ``` | ||
| 39 | |||
| 40 | ### Kind 1 events | ||
| 41 | |||
| 42 | In kind 1 events, the `content` should be emojified. | ||
| 43 | |||
| 44 | ```json | ||
| 45 | { | ||
| 46 | "kind": 1, | ||
| 47 | "content": "Hello :gleasonator: 😂 :ablobcatrainbow: :disputed: yolo", | ||
| 48 | "tags": [ | ||
| 49 | ["emoji", "ablobcatrainbow", "https://gleasonator.com/emoji/blobcat/ablobcatrainbow.png"], | ||
| 50 | ["emoji", "disputed", "https://gleasonator.com/emoji/Fun/disputed.png"], | ||
| 51 | ["emoji", "gleasonator", "https://gleasonator.com/emoji/Gleasonator/gleasonator.png"] | ||
| 52 | ], | ||
| 53 | "pubkey": "79c2cae114ea28a981e7559b4fe7854a473521a8d22a66bbab9fa248eb820ff6", | ||
| 54 | "created_at": 1682630000 | ||
| 55 | } | ||
| 56 | ``` \ No newline at end of file | ||
| @@ -45,6 +45,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/fia | |||
| 45 | - [NIP-26: Delegated Event Signing](26.md) | 45 | - [NIP-26: Delegated Event Signing](26.md) |
| 46 | - [NIP-27: Text Note References](27.md) | 46 | - [NIP-27: Text Note References](27.md) |
| 47 | - [NIP-28: Public Chat](28.md) | 47 | - [NIP-28: Public Chat](28.md) |
| 48 | - [NIP-30: Custom Emoji](30.md) | ||
| 48 | - [NIP-33: Parameterized Replaceable Events](33.md) | 49 | - [NIP-33: Parameterized Replaceable Events](33.md) |
| 49 | - [NIP-36: Sensitive Content](36.md) | 50 | - [NIP-36: Sensitive Content](36.md) |
| 50 | - [NIP-39: External Identities in Profiles](39.md) | 51 | - [NIP-39: External Identities in Profiles](39.md) |