gateway.schemas: validate Intents as an int

This commit is contained in:
Luna 2021-08-10 23:45:57 -03:00
parent 04b839b969
commit c0bac8bc21
2 changed files with 4 additions and 2 deletions

View File

@ -61,6 +61,9 @@ async def api_gateway_bot():
reset_ts = bucket._window + bucket.second
# how many seconds until bucket reset
# TODO: this logic should be changed to follow update_rate_limit's
# except we can't just call it since we don't use it here, but
# on the gateway side.
reset_after_ts = reset_ts - time.time()
# reset_after_ts must not be negative

View File

@ -23,7 +23,6 @@ from logbook import Logger
from litecord.gateway.errors import DecodeError
from litecord.schemas import LitecordValidator
from litecord.enums import Intents
log = Logger(__name__)
@ -64,7 +63,7 @@ IDENTIFY_SCHEMA = {
"large_threshold": {"type": "number", "required": False},
"shard": {"type": "list", "required": False},
"presence": {"type": "dict", "required": False},
"intents": {"coerce": Intents, "required": False},
"intents": {"type": int, "required": False},
# TODO schema
"properties": {
"type": "dict",