Occasionally a message will be relayed twice when coming from Telegram. This is a very rare occurrence, but happens nonetheless.
For supergroups, this seems to be an issue with Telegram sending the same message twice (with different message IDs).
For a standard group, the message IDs cannot be used for uniquely identifying a message, so the UNIX time that the message was sent is used instead. This is really not the best idea, but it's working for now and I don't see any other option.
Occasionally a message will be relayed twice when coming from Telegram. This is a very rare occurrence, but happens nonetheless.
See this class for implementation details.
Although this issue may be unavoidable, I will leave it open for further investigation and/or discussion.