Rename input_as_peer

This commit is contained in:
Lonami Exo 2023-09-02 20:36:50 +02:00
parent 2cabf6aa25
commit c44eb12c60
3 changed files with 5 additions and 5 deletions

View File

@ -80,7 +80,7 @@ from .users import (
get_input_entity, get_input_entity,
get_me, get_me,
get_peer_id, get_peer_id,
input_as_peer, input_to_peer,
resolve_to_packed, resolve_to_packed,
) )
@ -344,8 +344,8 @@ class Client:
async def _resolve_to_packed(self, chat: ChatLike) -> PackedChat: async def _resolve_to_packed(self, chat: ChatLike) -> PackedChat:
return await resolve_to_packed(self, chat) return await resolve_to_packed(self, chat)
def _input_as_peer(self, input: Optional[abcs.InputPeer]) -> Optional[abcs.Peer]: def _input_to_peer(self, input: Optional[abcs.InputPeer]) -> Optional[abcs.Peer]:
return input_as_peer(self, input) return input_to_peer(self, input)
async def get_peer_id(self) -> None: async def get_peer_id(self) -> None:
await get_peer_id(self) await get_peer_id(self)

View File

@ -497,7 +497,7 @@ class MessageMap:
def _empty(self, id: int = 0) -> Message: def _empty(self, id: int = 0) -> Message:
return Message._from_raw( return Message._from_raw(
types.MessageEmpty(id=id, peer_id=self._client._input_as_peer(self._peer)) types.MessageEmpty(id=id, peer_id=self._client._input_to_peer(self._peer))
) )

View File

@ -86,7 +86,7 @@ async def resolve_to_packed(self: Client, chat: ChatLike) -> PackedChat:
raise ValueError("Cannot resolve chat") raise ValueError("Cannot resolve chat")
def input_as_peer(self: Client, input: Optional[abcs.InputPeer]) -> Optional[abcs.Peer]: def input_to_peer(self: Client, input: Optional[abcs.InputPeer]) -> Optional[abcs.Peer]:
if input is None: if input is None:
return None return None
elif isinstance(input, types.InputPeerEmpty): elif isinstance(input, types.InputPeerEmpty):