Fix formatting

This commit is contained in:
Lonami Exo 2024-03-01 21:50:30 +01:00
parent 2f4065c958
commit 9ede5bd3c5
7 changed files with 17 additions and 13 deletions

View File

@ -629,7 +629,7 @@ class Client:
markdown=markdown, markdown=markdown,
html=html, html=html,
link_preview=link_preview, link_preview=link_preview,
buttons=buttons buttons=buttons,
) )
async def forward_messages( async def forward_messages(

View File

@ -117,7 +117,9 @@ async def get_chats(self: Client, chats: Sequence[ChatLike]) -> List[Chat]:
] ]
async def resolve_to_packed(client: Client, chat: Union[ChatLike, abcs.InputPeer, abcs.Peer]) -> PackedChat: async def resolve_to_packed(
client: Client, chat: Union[ChatLike, abcs.InputPeer, abcs.Peer]
) -> PackedChat:
if isinstance(chat, PackedChat): if isinstance(chat, PackedChat):
return chat return chat

View File

@ -1,7 +1,7 @@
from .callback import Data
from .combinators import All, Any, Filter, Not from .combinators import All, Any, Filter, Not
from .common import Chats, ChatType, Senders from .common import Chats, ChatType, Senders
from .messages import Command, Forward, Incoming, Media, Outgoing, Reply, Text from .messages import Command, Forward, Incoming, Media, Outgoing, Reply, Text
from .callback import Data
__all__ = [ __all__ = [
"All", "All",

View File

@ -1,7 +1,7 @@
from __future__ import annotations from __future__ import annotations
from .combinators import Combinable
from ..event import Event from ..event import Event
from .combinators import Combinable
class Data(Combinable): class Data(Combinable):

View File

@ -158,9 +158,7 @@ class Media(Combinable):
__slots__ = "_types" __slots__ = "_types"
def __init__( def __init__(self, *types: Literal["photo", "audio", "video"]) -> None:
self, *types: Literal["photo", "audio", "video"]
) -> None:
self._types = types or None self._types = types or None
@property @property

View File

@ -3,10 +3,10 @@ from __future__ import annotations
from typing import TYPE_CHECKING, Dict, Optional, Self from typing import TYPE_CHECKING, Dict, Optional, Self
from ...tl import abcs, functions, types from ...tl import abcs, functions, types
from ..types import Chat, Message
from .event import Event
from ..types.chat import peer_id
from ..client.messages import CherryPickedList from ..client.messages import CherryPickedList
from ..types import Chat, Message
from ..types.chat import peer_id
from .event import Event
if TYPE_CHECKING: if TYPE_CHECKING:
from ..client.client import Client from ..client.client import Client
@ -84,7 +84,11 @@ class ButtonCallback(Event):
chat = await self._client._resolve_to_packed(pid) chat = await self._client._resolve_to_packed(pid)
lst = CherryPickedList(self._client, chat, []) lst = CherryPickedList(self._client, chat, [])
lst._ids.append(types.InputMessageCallbackQuery(id=self._raw.msg_id, query_id=self._raw.query_id)) lst._ids.append(
types.InputMessageCallbackQuery(
id=self._raw.msg_id, query_id=self._raw.query_id
)
)
message = (await lst)[0] message = (await lst)[0]

View File

@ -13,6 +13,7 @@ from .._impl.client.events.filters import (
Chats, Chats,
ChatType, ChatType,
Command, Command,
Data,
Filter, Filter,
Forward, Forward,
Incoming, Incoming,
@ -22,7 +23,6 @@ from .._impl.client.events.filters import (
Reply, Reply,
Senders, Senders,
Text, Text,
Data,
) )
__all__ = [ __all__ = [
@ -40,5 +40,5 @@ __all__ = [
"Reply", "Reply",
"Senders", "Senders",
"Text", "Text",
"Data" "Data",
] ]