ChatSendRequest chat.send-request@1

Generated at from openvibe-contracts v0.114.0 and openvibe-sdk v0.35.1.

Version
1.1.0
Owner
chat
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/chat/send-request.v1.json

chat.send-request@1: what a sender hands OpenVibe.Chat to post a chat line (chat.message.send). From a browser, a frame on WS /ws/chat of type chat in the room the socket joined (the text is trimmed; empty or longer than 6000 characters is dropped, the channel's own max_message_length is enforced after that; a line starting with ! or / is a command, not a message). From Live's bridge, POST /internal/live/calls: a chat.live_bridge.write batch in which every op that sends a message (a chat or dm frame, db saveChatMessage, deployNotice) also needs chat.message.send; without it that op alone is refused. From a first-party service, POST /internal/chat/messages: one line (or one DM) that Chat stores, broadcasts to the room (with mirror, also to global chat and the streamer rooms), reads aloud (tts) and answers with the real id; applied once per (caller, key), the same key with another body gets 409.

Fields

This schema has no named fields.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: bridge-batch
{
  "boot": "b-1727300000000",
  "ops": [
    {
      "seq": 1,
      "op": "broadcastToStream",
      "args": [
        42,
        {
          "type": "chat",
          "username": "AI Viewer",
          "message": "hello chat"
        }
      ]
    }
  ]
}
Valid: ingress-dm
{
  "key": "live:call-dm:15:9f2c",
  "user_id": 3,
  "username": "host",
  "message": "Join my call",
  "dm": {
    "to_user_id": 15
  }
}
Valid: ingress-relay-line
{
  "key": "live:relay:twitch:abc123",
  "stream_id": 42,
  "username": "tw:someone",
  "message": "hello from twitch",
  "message_type": "chat",
  "source_platform": "twitch",
  "mirror": true,
  "tts": {
    "voice": null,
    "identity_key": "ext:twitch:someone"
  },
  "frame": {
    "role": "external",
    "is_bot": false
  },
  "first_chat_key": "ext:tw:someone"
}
Valid: ws-frame
{
  "type": "chat",
  "message": "gg that was clean",
  "reply_to_id": 81234,
  "auto_delete_minutes": 30
}
Rejected: empty-message
{
  "type": "chat",
  "message": ""
}
Rejected: ingress-blank-message
{
  "key": "k2",
  "username": "host",
  "message": "   "
}
Rejected: ingress-dm-with-room
{
  "key": "k1",
  "user_id": 3,
  "username": "host",
  "message": "hi",
  "stream_id": 42,
  "dm": {
    "to_user_id": 15
  }
}
Rejected: no-message
{
  "type": "chat",
  "text": "hello"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('chat.send-request@1', value);   // { valid, errors: [{ path, message }] }