mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-27 08:19:47 +03:00
Fix type annotations
This commit is contained in:
parent
6e72bf9179
commit
0f3c91eff7
|
@ -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],
|
||||||
):
|
):
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user