Telegram API does not return an unique update_id, only message_id is present.
The message_id is unique per chat, therefore cannot be used as a unique key constraint in messagesHistory.
Need to rework the unique constraint to store & validate new records neatly.
A proof of concept could be storing the message_id having it unique in pair with user_id.
Alternatively a string of chat_id-message_id can be used.
Telegram API does not return an unique update_id, only message_id is present. The message_id is unique per chat, therefore cannot be used as a unique key constraint in messagesHistory. Need to rework the unique constraint to store & validate new records neatly.
A proof of concept could be storing the message_id having it unique in pair with user_id. Alternatively a string of chat_id-message_id can be used.