upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/30.md
diff options
context:
space:
mode:
authorPablo Fernandez <p@f7z.io>2023-06-08 22:32:17 +0200
committerGitHub <noreply@github.com>2023-06-08 22:32:17 +0200
commit6baacf6fb1badf3ba2480a88519e357b3cbdaaac (patch)
treeb3d211bc3683b340d678c3574519f327e7b3858e /30.md
parent964bc5b5ce946ab66aae945084549f26ffdef70f (diff)
parent14a887d43b654f41de5d271e27ef69048f183fb4 (diff)
Merge branch 'master' into nip31
Diffstat (limited to '30.md')
-rw-r--r--30.md56
1 files changed, 56 insertions, 0 deletions
diff --git a/30.md b/30.md
new file mode 100644
index 0000000..ffc5aeb
--- /dev/null
+++ b/30.md
@@ -0,0 +1,56 @@
1NIP-30
2======
3
4Custom Emoji
5------------
6
7`draft` `optional` `author:alexgleason`
8
9Custom 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
15Where:
16
17- `<shortcode>` is a name given for the emoji, which MUST be comprised of only alphanumeric characters and underscores.
18- `<image-url>` is a URL to the corresponding image file of the emoji.
19
20For each emoji tag, clients should parse emoji shortcodes (aka "emojify") like `:shortcode:` in the event to display custom emoji.
21
22Clients 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
26In 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
42In 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```