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:
authorAlex Gleason <alex@alexgleason.me>2023-04-29 13:16:58 -0500
committerAlex Gleason <alex@alexgleason.me>2023-04-29 13:16:58 -0500
commite91ce3409e1ce8267fc07a21784d2538621267c3 (patch)
treec32342849f3e4bb3a213b531069e1b64c5ac41a6 /30.md
parent346036208ccca6f31313f1e909ff17ea3563fb46 (diff)
NIP-30: Custom Emoji
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..04689d0
--- /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.
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``` \ No newline at end of file