Support autocast to InputMessage

This commit is contained in:
Lonami Exo
2018-04-23 11:05:38 +02:00
parent 6ecef42ec7
commit f31ca142a3
6 changed files with 25 additions and 19 deletions

View File

@@ -297,13 +297,11 @@ class NewMessage(EventBuilder):
if self._reply_message is None:
if isinstance(self.input_chat, types.InputPeerChannel):
r = self._client(functions.channels.GetMessagesRequest(
self.input_chat, [
types.InputMessageID(self.message.reply_to_msg_id)
]
self.input_chat, [self.message.reply_to_msg_id]
))
else:
r = self._client(functions.messages.GetMessagesRequest(
[types.InputMessageID(self.message.reply_to_msg_id)]
[self.message.reply_to_msg_id]
))
if not isinstance(r, types.messages.MessagesNotModified):
self._reply_message = r.messages[0]