'Querying existing webhooks
An existing application has webhooks set up with the Telegram API.
A newer application want to use the same bot to send messages, eventually with the same named action webhook.
Initially, one would want to first query existing webhooks to identify existing ones, then possibly delete them, based on the increasing complexity of the operating context. The telegram API documentation does not appear to have methods for such actions.
A) can one query one's bot webhooks and delete them?
In any instance, the new server will have its own certificate for TLS communications.
curl -F "url=https://b.example.online/<WEBHOOKLOCATION>" https://api.telegram.org/bot<YOURTOKEN>/setWebhook
B) If one sets a new webhook with the same action (or webhooklocation in Telegram-speak) name, does that kill the existing ones, say
curl -F "url=https://a.example.online/<WEBHOOKLOCATION>" https://api.telegram.org/bot<YOURTOKEN>/setWebhook
or will the notifications be sent to two webhooks (i.e. the combination of certified URL and action name are considered a unique object) ?
C) what happens to the basic webhooks /start /help etc. ? Are they responded to by the Telegram servers if webhooks not present? Again, can they have multiple certified domain destinations to the same action
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
