From 2 days I have been studying the Telegram API, which is pretty neat. But there is one thing that I cannot understand.
If you are not using the webHook call but /getUpdates , you can tell the API through the offset parameter which message the server is processing.
But how do you do it with webHook? I get the same message as the update. This leads to the fact that the server sends the user the same message.
The solution I came up with is as follows:
- Get Update From Web Hosting
- Save
update_id - Reply to
/sendMessage - disable webHook
/setWebhook?url= - Set the offset
/getUpdates?offset={update_id+1} - Recover webHook
/setWebhook?url=https://mywebhook.domain.com
Should there be a better way? Is anyone
source share