Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

setWebhook

Set a webhook


Description

Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update.

Usage

setWebhook(url = NULL, certificate = NULL, max_connections = 40L,
  allowed_updates = NULL)

Arguments

url

HTTPS url to send updates to. Use an empty string to remove webhook integration.

certificate

(Optional). Upload your public key certificate so that the root certificate in use can be checked. See Telegram's self-signed guide for details.

max_connections

(Optional). Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.

allowed_updates

(Optional). String or vector of strings with the types of updates you want your bot to receive. For example, specify c("message", "edited_channel_post", "callback_query") to only receive updates of these types. See Update for a complete list of available update types. Specify an empty string to receive all updates regardless of type (default). If not specified, the previous setting will be used.

Please note that this parameter doesn't affect updates created before the call to the get_updates, so unwanted updates may be received for a short period of time.

Details

If you'd like to make sure that the webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>.

You can also use it's snake_case equivalent set_webhook.


telegram.bot

Develop a 'Telegram Bot' with R

v2.4.0
GPL-3
Authors
Ernest Benedito [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.