Raw.ActionCompleted

WebSocket event schema, payload, and examples

Properties

id
string required
actionId
string required
name
string
arguments
object
user
object required
duration
number required
queuedAt
string required
startedAt
string required
completedAt
string required
success
boolean required
excludeFromHistory
boolean required

Schema

The JSON Schema for the event payload, if available.
schema.json
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "ActionCompletedEvent",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "format": "guid"
    },
    "actionId": {
      "type": "string",
      "format": "guid"
    },
    "name": {
      "type": [
        "null",
        "string"
      ]
    },
    "arguments": {
      "type": [
        "null",
        "object"
      ],
      "additionalProperties": {}
    },
    "user": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/BaseViewer"
        }
      ]
    },
    "duration": {
      "type": "number",
      "format": "double"
    },
    "queuedAt": {
      "type": "string",
      "format": "date-time"
    },
    "startedAt": {
      "type": "string",
      "format": "date-time"
    },
    "completedAt": {
      "type": "string",
      "format": "date-time"
    },
    "success": {
      "type": "boolean"
    },
    "excludeFromHistory": {
      "type": "boolean"
    }
  },
  "definitions": {
    "BaseViewer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "display": {
          "type": [
            "null",
            "string"
          ]
        },
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "role": {
          "$ref": "#/definitions/ViewerRole"
        },
        "subscribed": {
          "type": "boolean"
        },
        "type": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "ViewerRole": {
      "type": "integer",
      "description": "",
      "x-enum-names": [
        "Unknown",
        "Viewer",
        "Vip",
        "Moderator",
        "Broadcaster"
      ],
      "x-enum-varnames": [
        "Unknown",
        "Viewer",
        "Vip",
        "Moderator",
        "Broadcaster"
      ],
      "x-enumNames": [
        "Unknown",
        "Viewer",
        "Vip",
        "Moderator",
        "Broadcaster"
      ],
      "x-enum-descriptions": [
        null,
        null,
        null,
        null,
        null
      ],
      "x-enumDescriptions": [
        null,
        null,
        null,
        null,
        null
      ],
      "enum": [
        0,
        1,
        2,
        3,
        4
      ]
    }
  }
}

JSON Payload

An example JSON payload for the event, automatically generated using JSONSchemaFaker
example.json
{
  "actionId": "6acd8938-23be-4571-acde-09a3e3f9d36d",
  "arguments": null,
  "completedAt": "1902-01-09T01:52:20.0Z",
  "duration": -38236279.39832002,
  "excludeFromHistory": false,
  "id": "4e8b3e4f-9635-4073-b7dc-cffd678a8f97",
  "name": null,
  "queuedAt": "1906-12-19T13:16:07.0Z",
  "startedAt": "1954-12-29T18:56:32.0Z",
  "success": false,
  "user": {
    "display": "sint elit ea et",
    "id": "est",
    "name": "quis in amet do ullamco",
    "role": 2,
    "subscribed": false,
    "type": "incididunt anim ut"
  }
}

Client Example

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 "Raw.ActionCompleted" events and register a callback
client.on('Raw.ActionCompleted', ({ 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);
});