diff --git a/litecord/gateway/websocket.py b/litecord/gateway/websocket.py index 6c83512..adf8795 100644 --- a/litecord/gateway/websocket.py +++ b/litecord/gateway/websocket.py @@ -415,7 +415,7 @@ class GatewayWebsocket: try: status = validate(status, GW_STATUS_UPDATE) except BadRequest as err: - log.warning(f'Invalid payload: {err}') + log.warning(f'Invalid status update: {err}') return # try to extract game from activities diff --git a/litecord/schemas.py b/litecord/schemas.py index 1240404..30a17a4 100644 --- a/litecord/schemas.py +++ b/litecord/schemas.py @@ -84,10 +84,6 @@ class LitecordValidator(Validator): def _validate_type_status_external(self, value: str) -> bool: statuses = StatusType.values() - - # clients should send INVISIBLE instead of OFFLINE - statuses.remove(StatusType.OFFLINE.value) - return value in statuses def _validate_type_explicit(self, value: str) -> bool: @@ -441,12 +437,13 @@ GW_ACTIVITY = { } GW_STATUS_UPDATE = { - 'status': {'type': 'status_external', 'required': False}, + 'status': {'type': 'status_external', 'required': False, + 'default': 'online'}, 'activities': { 'type': 'list', 'required': False, 'schema': GW_ACTIVITY}, 'afk': {'type': 'boolean', 'required': False}, - 'since': {'type': 'number', 'required': True, 'nullable': True}, + 'since': {'type': 'number', 'required': False, 'nullable': True}, 'game': { 'type': 'dict', 'required': False,