import { Api } from "https://dotland.deno.dev/x/grammy@v1.17.1/mod.ts";
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, we will 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.
Parameters
Optional AbortSignal
to cancel the request
Official reference: https://core.telegram.org/bots/api#setwebhook