Fix footgun in get_chats

This commit is contained in:
Lonami Exo 2024-03-16 23:45:58 +01:00
parent c15d07aa16
commit 9afe2f853d
2 changed files with 7 additions and 3 deletions

View File

@ -690,7 +690,9 @@ class Client:
"""
return get_admin_log(self, chat)
async def get_chats(self, chats: Sequence[ChatLike]) -> List[Chat]:
async def get_chats(
self, chats: Union[List[ChatLike], Tuple[ChatLike, ...]]
) -> List[Chat]:
"""
Get the latest basic information about the given chats.

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, List, Optional, Sequence, Union
from typing import TYPE_CHECKING, List, Optional, Tuple, Union
from ...mtproto import RpcError
from ...session import PackedChat, PackedType
@ -74,7 +74,9 @@ async def resolve_username(self: Client, username: str) -> Chat:
)
async def get_chats(self: Client, chats: Sequence[ChatLike]) -> List[Chat]:
async def get_chats(
self: Client, chats: Union[List[ChatLike], Tuple[ChatLike, ...]]
) -> List[Chat]:
packed_chats: List[PackedChat] = []
input_users: List[types.InputUser] = []
input_chats: List[int] = []