From f1e51484804cbf570b51f47605747e9357302017 Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Sun, 25 Oct 2026 05:33:11 +0100 Subject: [PATCH] add bot invocation contracts --- contracts/v1/bot-command-invoke-request.json | 14 ++++++++++++++ contracts/v1/bot-command-invoke-response.json | 14 ++++++++++++++ fixtures/v1/bot-command-invoke.response.json | 6 ++++++ 3 files changed, 34 insertions(+) create mode 100644 contracts/v1/bot-command-invoke-request.json create mode 100644 contracts/v1/bot-command-invoke-response.json create mode 100644 fixtures/v1/bot-command-invoke.response.json diff --git a/contracts/v1/bot-command-invoke-request.json b/contracts/v1/bot-command-invoke-request.json new file mode 100644 index 0000000..1d22eb3 --- /dev/null +++ b/contracts/v1/bot-command-invoke-request.json @@ -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" } } + } +} diff --git a/contracts/v1/bot-command-invoke-response.json b/contracts/v1/bot-command-invoke-response.json new file mode 100644 index 0000000..b4b6575 --- /dev/null +++ b/contracts/v1/bot-command-invoke-response.json @@ -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"] } + } +} diff --git a/fixtures/v1/bot-command-invoke.response.json b/fixtures/v1/bot-command-invoke.response.json new file mode 100644 index 0000000..5ec61a3 --- /dev/null +++ b/fixtures/v1/bot-command-invoke.response.json @@ -0,0 +1,6 @@ +{ + "status": "ok", + "response": "Hello Alice", + "remaining_cooldown_seconds": null, + "error": null +}