mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Add JSON Schema for Trivia Lists (#5565)
Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
parent
d9c46342d4
commit
8de6b97700
@ -36,6 +36,7 @@ ALWAYS_MATCH = Optional(Use(lambda x: x))
|
|||||||
MATCH_ALL_BUT_STR = Optional(Use(not_str))
|
MATCH_ALL_BUT_STR = Optional(Use(not_str))
|
||||||
TRIVIA_LIST_SCHEMA = Schema(
|
TRIVIA_LIST_SCHEMA = Schema(
|
||||||
{
|
{
|
||||||
|
Optional("$schema"): And(str, error=_("{key} key must be a text value.")),
|
||||||
Optional("AUTHOR"): And(str, error=_("{key} key must be a text value.")),
|
Optional("AUTHOR"): And(str, error=_("{key} key must be a text value.")),
|
||||||
Optional("CONFIG"): And(
|
Optional("CONFIG"): And(
|
||||||
{
|
{
|
||||||
|
|||||||
61
schema/trivia.schema.json
Normal file
61
schema/trivia.schema.json
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"$id": "https://raw.githubusercontent.com/Cog-Creators/Red-DiscordBot/V3/develop/schema/trivia.schema.json",
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
|
"title": "Red-DiscordBot Trivia List file",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"$schema": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uri"
|
||||||
|
},
|
||||||
|
"AUTHOR": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Author of the Trivia list."
|
||||||
|
},
|
||||||
|
"CONFIG": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "The configuration for a trivia session.",
|
||||||
|
"properties": {
|
||||||
|
"bot_plays": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether or not the bot gains points during the session."
|
||||||
|
},
|
||||||
|
"delay": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The maximum number of seconds permitted to answer a question, must be a positive number greater than or equal to 4.0.",
|
||||||
|
"minimum": 4.0
|
||||||
|
},
|
||||||
|
"max_score": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Number of points required in order to win the trivia, must be a positive integer.",
|
||||||
|
"exclusiveMinimum": 0
|
||||||
|
},
|
||||||
|
"payout_multiplier": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The payout multiplier, must be a positive number or zero.",
|
||||||
|
"minimum": 0
|
||||||
|
},
|
||||||
|
"reveal_answer": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether or not to reveal the answer when the question times out."
|
||||||
|
},
|
||||||
|
"timeout": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Number of seconds that need to pass until trivia stops due to no response, must be a positive number greater than 0.0.",
|
||||||
|
"exclusiveMinimum": 0
|
||||||
|
},
|
||||||
|
"use_spoilers": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether to hide the answers in spoilers when revealing the question's answers."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user