Raw.SubAction

WebSocket event schema, payload, and examples

Properties

The properties defined in the event schema, with descriptions.
actionId
string required
arguments
object
group
string
id
string required
name
string
parentId
string required
parentName
string
type
integer required
user
object required

Schema

The JSON Schema for the event payload, if available.
schema.json
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "SubActionEvent",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string"
    },
    "actionId": {
      "type": "string"
    },
    "name": {
      "type": [
        "null",
        "string"
      ]
    },
    "arguments": {
      "type": [
        "null",
        "object"
      ]
    },
    "user": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/BaseViewer"
        }
      ]
    },
    "parentId": {
      "type": "string"
    },
    "parentName": {
      "type": [
        "null",
        "string"
      ]
    },
    "group": {
      "type": [
        "null",
        "string"
      ]
    },
    "type": {
      "$ref": "#/$defs/SubActionType"
    }
  },
  "$defs": {
    "BaseViewer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "display": {
          "type": [
            "null",
            "string"
          ]
        },
        "id": {
          "type": [
            "null",
            "string"
          ]
        },
        "name": {
          "type": [
            "null",
            "string"
          ]
        },
        "role": {
          "$ref": "#/$defs/ViewerRole"
        },
        "subscribed": {
          "type": "boolean"
        },
        "type": {
          "type": [
            "null",
            "string"
          ]
        }
      }
    },
    "ViewerRole": {
      "type": "integer",
      "description": "",
      "enum": [
        0,
        1,
        2,
        3,
        4
      ]
    },
    "SubActionType": {
      "type": "integer",
      "description": "",
      "enum": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        16,
        17,
        18,
        19,
        20,
        21,
        22,
        23,
        24,
        25,
        26,
        27,
        28,
        29,
        30,
        31,
        32,
        33,
        34,
        35,
        36,
        37,
        38,
        39,
        40,
        41,
        42,
        43,
        44,
        45,
        46,
        47,
        48,
        49,
        50,
        51,
        52,
        120,
        121,
        122,
        123,
        124,
        125,
        126,
        127,
        128,
        200,
        201,
        202,
        203,
        204,
        205,
        206,
        207,
        208,
        209,
        210,
        211,
        212,
        213,
        214,
        215,
        251,
        252,
        253,
        254,
        321,
        322,
        323,
        324,
        325,
        326,
        327,
        328,
        329,
        401,
        402,
        403,
        404,
        405,
        406,
        407,
        408,
        409,
        410,
        411,
        412,
        413,
        414,
        415,
        416,
        417,
        500,
        501,
        502,
        503,
        504,
        505,
        506,
        507,
        508,
        509,
        510,
        511,
        512,
        513,
        520,
        521,
        522,
        523,
        524,
        525,
        526,
        527,
        528,
        529,
        530,
        531,
        550,
        551,
        552,
        553,
        554,
        555,
        556,
        557,
        558,
        560,
        561,
        562,
        563,
        564,
        565,
        566,
        567,
        568,
        569,
        570,
        571,
        572,
        573,
        601,
        602,
        603,
        604,
        605,
        606,
        607,
        701,
        1000,
        1001,
        1002,
        1003,
        1004,
        1005,
        1006,
        1007,
        1008,
        1009,
        1010,
        1011,
        1012,
        1013,
        1014,
        1015,
        1016,
        1017,
        1018,
        1019,
        1020,
        1021,
        1022,
        1023,
        1024,
        1025,
        1026,
        1027,
        1028,
        1029,
        1030,
        1031,
        1032,
        1033,
        1034,
        1035,
        1036,
        1037,
        1038,
        1039,
        1040,
        4001,
        4002,
        4003,
        4004,
        4005,
        4006,
        4007,
        4008,
        4009,
        4010,
        4011,
        4012,
        5001,
        5002,
        5003,
        5004,
        5005,
        5006,
        5007,
        5008,
        5009,
        5010,
        5011,
        5012,
        6001,
        6002,
        6003,
        6004,
        7001,
        8001,
        8002,
        9001,
        9002,
        9003,
        10001,
        11001,
        11002,
        11003,
        11004,
        11005,
        11006,
        11007,
        11008,
        12001,
        12002,
        12003,
        12004,
        12005,
        12006,
        12007,
        12008,
        12009,
        12010,
        14001,
        14002,
        14003,
        14004,
        14005,
        14006,
        14007,
        14008,
        14009,
        14010,
        14011,
        14012,
        14013,
        14014,
        14015,
        14016,
        14301,
        14302,
        14303,
        14304,
        14305,
        14306,
        14307,
        14308,
        14309,
        14310,
        14311,
        14312,
        14313,
        14314,
        14401,
        14402,
        14403,
        14404,
        14601,
        14602,
        14603,
        14604,
        14605,
        14606,
        14607,
        14608,
        14609,
        14610,
        14611,
        14612,
        14613,
        14614,
        14615,
        14616,
        14617,
        15001,
        19001,
        19002,
        19003,
        19004,
        19005,
        19006,
        20001,
        20002,
        20003,
        21001,
        21002,
        21003,
        21004,
        21005,
        21006,
        21007,
        21008,
        21009,
        21010,
        30001,
        30002,
        35001,
        35002,
        35010,
        35011,
        35012,
        35020,
        35021,
        35022,
        35030,
        35031,
        35040,
        35041,
        35042,
        35043,
        35101,
        35102,
        35103,
        35104,
        35105,
        35106,
        35107,
        35108,
        35109,
        35110,
        35111,
        35112,
        35113,
        40000,
        40001,
        41001,
        41002,
        41003,
        41004,
        41005,
        41006,
        41007,
        41008,
        41009,
        41010,
        41012,
        41013,
        41014,
        41015,
        41016,
        41017,
        44001,
        99900,
        99901,
        99902,
        99903,
        99904,
        99998,
        99999
      ]
    }
  }
}

JSON Payload

An example JSON payload for the event, automatically generated using JSONSchemaFaker
example.json
{
  "id": "",
  "actionId": "d7fHeVH7O",
  "name": "8JjZfGE6X",
  "arguments": null,
  "user": null,
  "parentId": "ieNk",
  "parentName": "X1g",
  "group": "gnp3e",
  "type": 19003
}

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