Getting the earliest message to reply to

This commit is contained in:
Ilya Greznev 2023-05-31 01:08:48 +03:00
parent 7e9e058b71
commit 538b07c8db

View File

@ -617,7 +617,7 @@ class MessageMethods:
peer=entity,
msg_id=utils.get_message_id(message)
))
m = r.messages[-1]
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)
return utils.get_input_peer(chat), m.id