mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix utils.get_peer not handling Self in get_messages
This commit is contained in:
parent
44e2ef6c79
commit
1a2e09487c
|
@ -290,7 +290,7 @@ class _IDsIter(RequestIter):
|
|||
else:
|
||||
r = await self.client(functions.messages.GetMessagesRequest(ids))
|
||||
if self._entity:
|
||||
from_id = utils.get_peer(self._entity)
|
||||
from_id = await self.client._get_peer(self._entity)
|
||||
|
||||
if isinstance(r, types.messages.MessagesNotModified):
|
||||
self.buffer.extend(None for _ in ids)
|
||||
|
@ -804,7 +804,7 @@ class MessageMethods:
|
|||
if isinstance(result, types.UpdateShortSentMessage):
|
||||
message = types.Message(
|
||||
id=result.id,
|
||||
peer_id=utils.get_peer(entity),
|
||||
peer_id=await self.client.get_peer(entity),
|
||||
message=message,
|
||||
date=result.date,
|
||||
out=result.out,
|
||||
|
|
|
@ -463,6 +463,10 @@ class UserMethods:
|
|||
.format(peer)
|
||||
)
|
||||
|
||||
async def _get_peer(self: 'TelegramClient', peer: 'hints.EntityLike'):
|
||||
i, cls = utils.resolve_id(await self.get_peer_id(peer))
|
||||
return cls(i)
|
||||
|
||||
async def get_peer_id(
|
||||
self: 'TelegramClient',
|
||||
peer: 'hints.EntityLike',
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Versions should comply with PEP440.
|
||||
# This line is parsed in setup.py:
|
||||
__version__ = '1.17.1'
|
||||
__version__ = '1.17.2'
|
||||
|
|
Loading…
Reference in New Issue
Block a user