From 61528ccfe107af257162362cedd82611605293f3 Mon Sep 17 00:00:00 2001 From: TeksuSiK Date: Mon, 18 Aug 2025 12:51:55 +0200 Subject: [PATCH 1/2] Make code fragments with JSON payloads fully valid --- events/event-types.md | 72 ++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/events/event-types.md b/events/event-types.md index bf3a5fe..7d179f5 100644 --- a/events/event-types.md +++ b/events/event-types.md @@ -7,11 +7,12 @@ description: Request body payloads for Webhook API requests ## Chat Message -```json +``` Headers - Kick-Event-Type: “chat.message.sent” - Kick-Event-Version: “1” - +``` +```json { "message_id": "unique_message_id_123", "broadcaster": { @@ -21,7 +22,7 @@ Headers "is_verified": true, "profile_picture": "https://example.com/broadcaster_avatar.jpg", "channel_slug": "broadcaster_channel", - "identity": null // no identity for broadcasters at the moment + "identity": null }, "sender": { "is_anonymous": false, @@ -35,17 +36,17 @@ Headers "badges": [ { "text": "Moderator", - "type": "moderator", + "type": "moderator" }, { "text": "Sub Gifter", "type": "sub_gifter", - "count": 5, + "count": 5 }, { "text": "Subscriber", "type": "subscriber", - "count": 3, + "count": 3 } ] } @@ -71,11 +72,12 @@ Headers ## Channel Follow -```json +``` Headers - Kick-Event-Type: “channel.followed” - Kick-Event-Version: “1” - +``` +```json { "broadcaster": { "is_anonymous": false, @@ -100,11 +102,12 @@ Headers ## Channel Subscription Renewal -```json +``` Headers - Kick-Event-Type: “channel.subscription.renewal” - Kick-Event-Version: “1” - +``` +```json { "broadcaster": { "is_anonymous": false, @@ -131,13 +134,13 @@ Headers ``` ## Channel Subscription Gifts - -```json +Fields in `gifter` are null if the gifter is anonymous (`gifter.is_anonymous`). +``` Headers - Kick-Event-Type: “channel.subscription.gifts” - Kick-Event-Version: “1” - -Public Gift Structure +``` +```json { "broadcaster": { "is_anonymous": false, @@ -150,12 +153,12 @@ Public Gift Structure }, "gifter": { "is_anonymous": false, - "user_id": 987654321, // null if is_anonymous=true - "username": "gifter_name", // null if is_anonymous=true - "is_verified": false, // null if is_anonymous=true - "profile_picture": "https://example.com/sender_avatar.jpg", // null if is_anonymous=true - "channel_slug": "gifter_channel", // null if is_anonymous=true - "identity": null // null if is_anonymous=true + "user_id": 987654321, + "username": "gifter_name", + "is_verified": false, + "profile_picture": "https://example.com/sender_avatar.jpg", + "channel_slug": "gifter_channel", + "identity": null }, "giftees": [ @@ -176,11 +179,12 @@ Public Gift Structure ## Channel Subscription Created -```json +``` Headers - Kick-Event-Type: “channel.subscription.new” - Kick-Event-Version: “1” - +``` +```json { "broadcaster": { "is_anonymous": false, @@ -209,11 +213,12 @@ Headers ## Livestream Status Updated #### Livestream Status Updated - Stream started -```json +``` Headers - Kick-Event-Type: "livestream.status.updated" - Kick-Event-Version: “1” - +``` +```json { "broadcaster": { "is_anonymous": false, @@ -232,11 +237,12 @@ Headers ``` #### Livestream Status Updated - Stream ended -```json +``` Headers - Kick-Event-Type: "livestream.status.updated" - Kick-Event-Version: “1” - +``` +```json { "broadcaster": { "is_anonymous": false, @@ -256,11 +262,12 @@ Headers ## Livestream Metadata Updated -```json +``` Headers - Kick-Event-Type: "livestream.metadata.updated" - Kick-Event-Version: “1” - +``` +```json { "broadcaster": { "is_anonymous": false, @@ -285,12 +292,13 @@ Headers ``` ## Moderation Banned - -```json +`metadata.expires_at` is null if ban is permanent. +``` Headers - Kick-Event-Type: "moderation.banned" - Kick-Event-Version: “1” - +``` +```json { "broadcaster": { "is_anonymous": false, @@ -322,7 +330,7 @@ Headers "metadata": { "reason": "banned reason", "created_at": "2025-01-14T16:08:05Z", - "expires_at": "2025-01-14T16:10:06Z", // null for permanent bans + "expires_at": "2025-01-14T16:10:06Z" } } ``` \ No newline at end of file From 10b53f81d3f45892aa74079474dab9b8245851d9 Mon Sep 17 00:00:00 2001 From: TeksuSiK Date: Mon, 18 Aug 2025 12:56:36 +0200 Subject: [PATCH 2/2] Add note about identity for broadcaster in chat.message.sent.event, formatting --- events/event-types.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/events/event-types.md b/events/event-types.md index 7d179f5..941ec2a 100644 --- a/events/event-types.md +++ b/events/event-types.md @@ -7,6 +7,7 @@ description: Request body payloads for Webhook API requests ## Chat Message +No identity for broadcasters at the moment. ``` Headers - Kick-Event-Type: “chat.message.sent” @@ -134,6 +135,7 @@ Headers ``` ## Channel Subscription Gifts + Fields in `gifter` are null if the gifter is anonymous (`gifter.is_anonymous`). ``` Headers @@ -213,6 +215,7 @@ Headers ## Livestream Status Updated #### Livestream Status Updated - Stream started + ``` Headers - Kick-Event-Type: "livestream.status.updated" @@ -237,6 +240,7 @@ Headers ``` #### Livestream Status Updated - Stream ended + ``` Headers - Kick-Event-Type: "livestream.status.updated" @@ -292,6 +296,7 @@ Headers ``` ## Moderation Banned + `metadata.expires_at` is null if ban is permanent. ``` Headers