Fix comment_to for a group of messages (#4120)

This commit is contained in:
iamilya 2023-05-31 18:04:33 +03:00 committed by GitHub
parent 0f0ca6b0d9
commit aab8009a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -617,7 +617,7 @@ class MessageMethods:
peer=entity, peer=entity,
msg_id=utils.get_message_id(message) msg_id=utils.get_message_id(message)
)) ))
m = r.messages[0] m = min(r.messages, key=lambda msg: msg.id)
chat = next(c for c in r.chats if c.id == m.peer_id.channel_id) chat = next(c for c in r.chats if c.id == m.peer_id.channel_id)
return utils.get_input_peer(chat), m.id return utils.get_input_peer(chat), m.id