add bot invocation contracts

This commit is contained in:
2026-10-25 05:33:11 +01:00
parent 1a28d120c2
commit f1e5148480
3 changed files with 34 additions and 0 deletions
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.invalid/contracts/v1/bot-command-invoke-request.json",
"title": "Trixie bot command invocation request",
"type": "object",
"additionalProperties": false,
"required": ["name", "user_id", "permission_level"],
"properties": {
"name": { "type": "string", "minLength": 1, "maxLength": 64 },
"user_id": { "type": "string", "minLength": 1, "maxLength": 64 },
"permission_level": { "enum": ["everyone", "subscriber", "moderator", "broadcaster"] },
"variables": { "type": "object", "additionalProperties": { "type": "string" } }
}
}
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://trixie.invalid/contracts/v1/bot-command-invoke-response.json",
"title": "Trixie bot command invocation response",
"type": "object",
"additionalProperties": false,
"required": ["status", "response", "remaining_cooldown_seconds", "error"],
"properties": {
"status": { "enum": ["ok", "cooldown", "not_found", "permission_denied", "error"] },
"response": { "type": ["string", "null"] },
"remaining_cooldown_seconds": { "type": ["integer", "null"], "minimum": 0 },
"error": { "type": ["string", "null"] }
}
}
@@ -0,0 +1,6 @@
{
"status": "ok",
"response": "Hello Alice",
"remaining_cooldown_seconds": null,
"error": null
}