ApiMethods.setWebhook(args: { url: string; certificate?: F; ip_address?: string; max_connections?: number; allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>; drop_pending_updates?: boolean; secret_token?: string; }): true
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. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable amount of attempts. Returns True on success.
If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
Notes
- You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
- To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
- Ports currently supported for Webhooks: 443, 80, 88, 8443.
If you're having any trouble setting up webhooks, please check out this amazing guide to webhooks.
args: { url: string; certificate?: F; ip_address?: string; max_connections?: number; allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>; drop_pending_updates?: boolean; secret_token?: string; }