mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
parent
856538635d
commit
29eb90e503
|
@ -1,5 +1,5 @@
|
|||
from .common import EventBuilder, EventCommon, name_inner_event
|
||||
from .. import utils
|
||||
from .. import utils, helpers
|
||||
from ..tl import types, functions
|
||||
|
||||
|
||||
|
@ -261,17 +261,8 @@ class ChatAction(EventBuilder):
|
|||
|
||||
if isinstance(self._pinned_message, int)\
|
||||
and await self.get_input_chat():
|
||||
r = await self._client(functions.channels.GetMessagesRequest(
|
||||
self._input_chat, [self._pinned_message]
|
||||
))
|
||||
try:
|
||||
self._pinned_message = next(
|
||||
x for x in r.messages
|
||||
if isinstance(x, types.Message)
|
||||
and x.id == self._pinned_message
|
||||
)
|
||||
except StopIteration:
|
||||
pass
|
||||
self._pinned_message = await self._client.get_messages(
|
||||
self._input_chat, ids=self._pinned_message)
|
||||
|
||||
if isinstance(self._pinned_message, types.Message):
|
||||
return self._pinned_message
|
||||
|
|
Loading…
Reference in New Issue
Block a user