Add typed command argument contract
This commit is contained in:
@@ -43,3 +43,6 @@ contain only local synthetic data.
|
|||||||
Named-user command rules use `bot-command-user-rule.json`; fixtures contain
|
Named-user command rules use `bot-command-user-rule.json`; fixtures contain
|
||||||
only synthetic Twitch IDs and literal response templates.
|
only synthetic Twitch IDs and literal response templates.
|
||||||
|
|
||||||
|
Typed command arguments use `bot-command-argument-definition.json` and remain
|
||||||
|
literal validated data.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||||
|
"$id": "https://trixie.invalid/contracts/v1/bot-command-argument-definition.json",
|
||||||
|
"title": "Trixie typed bot command argument",
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": ["name", "kind", "required"],
|
||||||
|
"properties": {
|
||||||
|
"name": { "type": "string", "pattern": "^[A-Za-z0-9_]{1,64}$" },
|
||||||
|
"kind": { "enum": ["text", "number", "choice", "username", "duration"] },
|
||||||
|
"required": { "type": "boolean" },
|
||||||
|
"default": { "type": ["string", "null"], "maxLength": 200 },
|
||||||
|
"minimum": { "type": ["integer", "null"] },
|
||||||
|
"maximum": { "type": ["integer", "null"] },
|
||||||
|
"choices": { "type": "array", "maxItems": 64, "items": { "type": "string", "minLength": 1, "maxLength": 200 } }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"kind": "number",
|
||||||
|
"required": true,
|
||||||
|
"default": null,
|
||||||
|
"minimum": 1,
|
||||||
|
"maximum": 5,
|
||||||
|
"choices": []
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user