YouTube.JewelsGifted

WebSocket event schema, payload, and examples
The properties defined in the event schema, with descriptions.
altText
string
broadcast
object required
comboCount
integer required
durationNanoSeconds
integer required
durationSeconds
integer required
eventId
string
hasVisualEffect
boolean required
isCombo
boolean required
isTest
boolean required
jewelsAmount
integer required
language
string
name
string
publishedAt
string required
url
string
user
object required
The JSON Schema for the event payload, if available.
schema.json
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "YouTubeJewelsGiftedEvent",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "user": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/YouTubeBaseUser"
        }
      ]
    },
    "eventId": {
      "type": [
        "null",
        "string"
      ]
    },
    "publishedAt": {
      "type": "string"
    },
    "broadcast": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/YouTubeBroadcastWebsocketData"
        }
      ]
    },
    "isTest": {
      "type": "boolean"
    },
    "jewelsAmount": {
      "type": "integer"
    },
    "name": {
      "type": [
        "null",
        "string"
      ]
    },
    "url": {
      "type": [
        "null",
        "string"
      ]
    },
    "durationSeconds": {
      "type": "integer"
    },
    "durationNanoSeconds": {
      "type": "integer"
    },
    "hasVisualEffect": {
      "type": "boolean"
    },
    "isCombo": {
      "type": "boolean"
    },
    "comboCount": {
      "type": "integer"
    },
    "altText": {
      "type": [
        "null",
        "string"
      ]
    },
    "language": {
      "type": [
        "null",
        "string"
      ]
    }
  },
  "$defs": {
    "YouTubeBaseUser": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "login": {
          "type": [
            "null",
            "string"
          ]
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "type": {
          "type": "string"
        },
        "url": {
          "type": [
            "null",
            "string"
          ]
        },
        "profileImageUrl": {
          "type": [
            "null",
            "string"
          ]
        },
        "isOwner": {
          "type": "boolean"
        },
        "isModerator": {
          "type": "boolean"
        },
        "isSponsor": {
          "type": "boolean"
        },
        "isVerified": {
          "type": "boolean"
        }
      }
    },
    "YouTubeBroadcastWebsocketData": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "channelId": {
          "type": [
            "null",
            "string"
          ]
        },
        "liveChatId": {
          "type": [
            "null",
            "string"
          ]
        },
        "title": {
          "type": [
            "null",
            "string"
          ]
        },
        "description": {
          "type": [
            "null",
            "string"
          ]
        },
        "categoryId": {
          "type": [
            "null",
            "string"
          ]
        },
        "privacy": {
          "type": [
            "null",
            "string"
          ]
        },
        "publishedAt": {
          "type": "string"
        },
        "scheduledStartTime": {
          "type": "string"
        },
        "scheduledEndTime": {
          "type": "string"
        },
        "actualStartTime": {
          "type": "string"
        },
        "actualEndTime": {
          "type": "string"
        },
        "tags": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "defaultLanguage": {
          "type": [
            "null",
            "string"
          ]
        },
        "defaultAudioLanguage": {
          "type": [
            "null",
            "string"
          ]
        },
        "status": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    }
  }
}
An example JSON payload for the event, automatically generated using JSONSchemaFaker
example.json
{
  "user": null,
  "eventId": "1IFAFbOLl",
  "publishedAt": "5NK",
  "broadcast": null,
  "isTest": true,
  "jewelsAmount": 397,
  "name": "GB",
  "url": "10yS",
  "durationSeconds": -780,
  "durationNanoSeconds": 37,
  "hasVisualEffect": true,
  "isCombo": true,
  "comboCount": -667,
  "altText": null,
  "language": ""
}
Example code showing how to subscribe to this event using the Streamer.bot WebSocket Client
index.js
// Initialize the Streamer.bot WebSocket Client
const client = new StreamerbotClient();

// Subscribe to "YouTube.JewelsGifted" events and register a callback
client.on('YouTube.JewelsGifted', ({ event, data }) => {
  // Code here will run every time the event is received!
  console.log('Received event:', event.source, event.type);
  console.log('Event data:', data);
});