Chat command registration request chat.command-registration-request@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- chat
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/chat/command-registration-request.v1.json
chat.command-registration-request@1: an approved app or Actor agent registers a plain-response command in a server that the person named in its service token manages. The command cannot override a built-in. The template's {args} placeholder receives the invoking person's argument text; Chat posts the expanded result as that person after checking their current room rights.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
server | string | yes |
| |
command | chat.command | yes | ||
response_template | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: hello
{
"server": "command-tests",
"command": {
"name": "hello",
"description": "Say hello",
"options": [
{
"name": "text",
"description": "Who to greet",
"type": "string",
"required": false
}
]
},
"response_template": "Hello, {args}!"
}Rejected: no-template
{
"server": "command-tests",
"command": {
"name": "hello",
"description": "Say hello",
"options": []
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('chat.command-registration-request@1', value); // { valid, errors: [{ path, message }] }