What does the three dashes mean?
In general, the docs and the examples are not clear on how to use webhooks.
Should I call myself telegrams API to register the webhook, or does telegraf handles this for me?
Why does "start webhook directly" requires two steps and a secret path but the bot.launch method does not?
What will be the endpoint that I need to register telegram with when using the launch method? My guess is that telegraf generates it automatically but I need to know this for debugging.
Ok, after some tinkering I figured myself most of the stuff. Still I think it is good to have these things documented.
My findings:
Three dashes are just an example. the domain parameter is where bot's back-end is deployed. When using the launch function, telegraf will register an endpoint with telegram and will set up the routing inside your application. It will look like https://yourdomain.net/telegraf/<secret hash>. To find out what is the registered endpoint I used getWebhookInfo API call (GET of https://api.telegram.org/bot<bot token>/getWebhookInfo).
// npm install -g localtunnel && lt --port 3000
This comment in line 1 gives you information how to acquire the domain
what if i want to use serveo? please help me
Most helpful comment
Ok, after some tinkering I figured myself most of the stuff. Still I think it is good to have these things documented.
My findings:
Three dashes are just an example. the domain parameter is where bot's back-end is deployed. When using the
launchfunction, telegraf will register an endpoint with telegram and will set up the routing inside your application. It will look likehttps://yourdomain.net/telegraf/<secret hash>. To find out what is the registered endpoint I usedgetWebhookInfoAPI call (GET ofhttps://api.telegram.org/bot<bot token>/getWebhookInfo).