diff --git a/README.md b/README.md index 95fcbaa..089b0bf 100644 --- a/README.md +++ b/README.md @@ -40,3 +40,6 @@ Command simulation uses `bot-command-simulate-request.json` and real network requests require an explicit `use_real_request` flag; fixtures contain only local synthetic data. +Named-user command rules use `bot-command-user-rule.json`; fixtures contain +only synthetic Twitch IDs and literal response templates. + diff --git a/contracts/v1/bot-command-user-rule.json b/contracts/v1/bot-command-user-rule.json new file mode 100644 index 0000000..49fc01d --- /dev/null +++ b/contracts/v1/bot-command-user-rule.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://trixie.invalid/contracts/v1/bot-command-user-rule.json", + "title": "Trixie named-user command rule", + "type": "object", + "additionalProperties": false, + "required": ["user_id"], + "properties": { + "user_id": { "type": "string", "pattern": "^[0-9]{1,64}$" }, + "response_template": { "type": ["string", "null"], "minLength": 1, "maxLength": 2000 } + } +} diff --git a/fixtures/v1/bot-command-user-rule.json b/fixtures/v1/bot-command-user-rule.json new file mode 100644 index 0000000..34868e0 --- /dev/null +++ b/fixtures/v1/bot-command-user-rule.json @@ -0,0 +1,4 @@ +{ + "user_id": "123456789", + "response_template": "Welcome back, ${user_name}!" +}