Fix type annotations

This commit is contained in:
Jahongir Qurbonov 2024-09-01 14:30:08 +05:00
parent 6e72bf9179
commit 0f3c91eff7
3 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ from collections.abc import AsyncIterator
from typing import TYPE_CHECKING, Optional, Self from typing import TYPE_CHECKING, Optional, Self
from ...session import PeerRef, UserRef from ...session import PeerRef, UserRef
from ...tl import functions, types from ...tl import abcs, functions, types
from ..types import InlineResult, NoPublicConstructor, Peer, User from ..types import InlineResult, NoPublicConstructor, Peer, User
if TYPE_CHECKING: if TYPE_CHECKING:
@ -15,7 +15,7 @@ class InlineResults(metaclass=NoPublicConstructor):
def __init__( def __init__(
self, self,
client: Client, client: Client,
bot: types.InputUser, bot: abcs.InputUser,
query: str, query: str,
peer: Optional[PeerRef], peer: Optional[PeerRef],
): ):

View File

@ -66,9 +66,9 @@ async def resolve_username(self: Client, username: str, /) -> Peer:
async def resolve_peers(self: Client, peers: Sequence[Peer | PeerRef], /) -> list[Peer]: async def resolve_peers(self: Client, peers: Sequence[Peer | PeerRef], /) -> list[Peer]:
refs: list[PeerRef] = [] refs: list[PeerRef] = []
input_users: list[types.InputUser] = [] input_users: list[abcs.InputUser] = []
input_chats: list[int] = [] input_chats: list[int] = []
input_channels: list[types.InputChannel] = [] input_channels: list[abcs.InputChannel] = []
for peer in peers: for peer in peers:
peer = peer._ref peer = peer._ref

View File

@ -35,7 +35,7 @@ class Combinable(abc.ABC):
return self.filter if isinstance(self, Not) else Not(self) return self.filter if isinstance(self, Not) else Not(self)
@abc.abstractmethod @abc.abstractmethod
async def __call__(self, event: Event) -> bool: def __call__(self, event: Event) -> bool | Awaitable[bool]:
pass pass