Implement [p]trivia info and add DESCRIPTION to trivia schema (#5897)

Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
Kreusada
2024-03-31 02:11:17 +01:00
committed by GitHub
parent c3a493a500
commit 48d74712bc
59 changed files with 224 additions and 20 deletions

View File

@@ -37,7 +37,16 @@ MATCH_ALL_BUT_STR = Optional(Use(not_str))
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,
lambda text: 1 <= len(text) <= 1000,
error=_("{key} key must be a text value not longer than 1000 characters."),
),
Optional("DESCRIPTION"): And(
str,
lambda text: 1 <= len(text) <= 200,
error=_("{key} key must be a text value not longer than 200 characters."),
),
Optional("CONFIG"): And(
{
Optional("max_score"): And(