According to #361 #43 right way to get new messages is TLRequestGetDifference or HandleUpdate usage. Also we can find official manual about processing updates: https://core.telegram.org/api/updates
Here we need an source code example. Same questions: #564 #239 #436 #457 #524 #538 #547 #570