bug: Duplicate message ID

- If a message is replied to, the replied ID is returned instead of the message ID of the sent message
This commit is contained in:
Nick Ninov
2026-08-29 21:53:16 +03:00
parent d90ca78869
commit aa216d3ff1
+5 -1
View File
@@ -796,7 +796,11 @@ class Account:
if error:
raise exceptions.SendContentError(error.get("message"))
return response["result"]["messages"][0]["id"]
messages = response["result"]["messages"]
if reply_to_message_id and len(messages) > 1:
messages = [m for m in messages if m["id"] != reply_to_message_id] or messages
return max(messages, key=lambda m: m.get("clock", 0))["id"]
def delete_message(self, id: str) -> bool:
"""