From d39e161deb9208065cd7d2cd0c47cf552ed598f8 Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Thu, 22 Nov 2018 16:20:44 -0300 Subject: [PATCH] schemas: add theme type - schemas: add USER_SETTINGS.theme --- litecord/schemas.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/litecord/schemas.py b/litecord/schemas.py index b191bf5..5daf249 100644 --- a/litecord/schemas.py +++ b/litecord/schemas.py @@ -124,6 +124,9 @@ class LitecordValidator(Validator): # for now, we'll use the same validation for guild_name return self._validate_type_guild_name(value) + def _validate_type_theme(self, value: str) -> bool: + return value in ['light', 'dark'] + def validate(reqjson: Union[Dict, List], schema: Dict, raise_err: bool = True) -> Union[Dict, List]: @@ -513,7 +516,8 @@ USER_SETTINGS = { 'timezone_offset': {'type': 'number', 'required': False}, - 'status': {'type': 'status_external', 'required': False} + 'status': {'type': 'status_external', 'required': False}, + 'theme': {'type': 'theme', 'required': False} } RELATIONSHIP = {