Fix some webhook related type checker errors

This commit is contained in:
Rapptz
2021-06-10 07:57:41 -04:00
parent 0dd4c4c08c
commit fc66c5b92d
3 changed files with 7 additions and 5 deletions

View File

@@ -464,8 +464,8 @@ def to_json(obj: Any) -> str:
return json.dumps(obj, separators=(',', ':'), ensure_ascii=True)
def _parse_ratelimit_header(request: _RequestLike, *, use_clock: bool = False) -> float:
reset_after = request.headers.get('X-Ratelimit-Reset-After')
def _parse_ratelimit_header(request: Any, *, use_clock: bool = False) -> float:
reset_after: Optional[str] = request.headers.get('X-Ratelimit-Reset-After')
if use_clock or not reset_after:
utc = datetime.timezone.utc
now = datetime.datetime.now(utc)