You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Telegram: receive updates by polling (getUpdates) for servers without a public HTTPS address #1873
The Telegram module receives messages only through a webhook: when an account of the Telegram messenger is created, it registers webServerUrl() + '/exec/webHookTelegram?botid=<account>' with Telegram, which then calls that address for every update. The web server must therefore be reachable from Telegram over HTTPS.
A server without such an address (an installation behind a firewall, a developer machine) cannot receive at all: the registration fails and the account is not created, or, with skipSetWebHookTelegram[Account] implemented, the account is created but can only send. Telegram's own alternative for this case, getUpdates (long polling), has no action in the module, and once a webhook is registered Telegram refuses getUpdates until the webhook is deleted. An application that needs polling has to reimplement the update handling of webHookTelegram[JSONFILE] itself.
Fix
An account of the Telegram messenger gets a receiving mode: webhook (as now) or polling. In the polling mode no webhook is registered (a registered one is deleted), and a new action receiveUpdatesTelegram[Account] requests the updates since the last processed one with getUpdates and handles each of them exactly as the webhook action does (chat creation, message storage), so that the scheduler can run it. The messengers documentation describes both modes.
Reason
Many installations have no address reachable from the Internet, and today a Telegram bot on them cannot receive messages at all.
Activity