From 5a22d6063d45baabc3b5a9aae3cd038caaa462f3 Mon Sep 17 00:00:00 2001 From: Zomatree Date: Fri, 29 Dec 2023 20:21:48 +0000 Subject: [PATCH] Fix typing bugs --- revolt/ext/commands/client.py | 2 +- revolt/ext/commands/cog.py | 4 ++-- revolt/websocket.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/revolt/ext/commands/client.py b/revolt/ext/commands/client.py index f3cc68d..f9507d4 100755 --- a/revolt/ext/commands/client.py +++ b/revolt/ext/commands/client.py @@ -36,7 +36,7 @@ class ExtensionProtocol(Protocol): class CommandsMeta(type): _commands: list[Command[Any]] - def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any]) -> Self: + def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any]) -> Any: commands: list[Command[Any]] = [] self = super().__new__(cls, name, bases, attrs) diff --git a/revolt/ext/commands/cog.py b/revolt/ext/commands/cog.py index 8ac3816..63ef13a 100755 --- a/revolt/ext/commands/cog.py +++ b/revolt/ext/commands/cog.py @@ -1,7 +1,7 @@ from __future__ import annotations from typing import Any, Callable, Coroutine, Generic, Optional, TypeVar, cast -from typing_extensions import ParamSpec, Self +from typing_extensions import ParamSpec from revolt.errors import RevoltError @@ -18,7 +18,7 @@ class CogMeta(type, Generic[ClientT_D]): _cog_listeners: dict[str, list[str]] qualified_name: str - def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any], *, qualified_name: Optional[str] = None, extras: dict[str, Any] | None = None) -> Self: + def __new__(cls, name: str, bases: tuple[type, ...], attrs: dict[str, Any], *, qualified_name: Optional[str] = None, extras: dict[str, Any] | None = None) -> Any: commands: list[Command[ClientT_D]] = [] listeners: dict[str, list[str]] = {} diff --git a/revolt/websocket.py b/revolt/websocket.py index ae8146b..93a4dcb 100755 --- a/revolt/websocket.py +++ b/revolt/websocket.py @@ -82,7 +82,7 @@ class WebsocketHandler: async def send_payload(self, payload: BasePayload) -> None: if use_msgpack: - await self.websocket.send_bytes(msgpack.packb(payload)) + await self.websocket.send_bytes(msgpack.packb(payload)) # type: ignore else: await self.websocket.send_str(json.dumps(payload)) @@ -482,7 +482,7 @@ class WebsocketHandler: if use_msgpack: data = cast(bytes, msg.data) - payload = msgpack.unpackb(data) + payload = msgpack.unpackb(data) # type: ignore else: data = cast(str, msg.data)