defstudio / telegraph

Telegraph is a Laravel package for fluently interacting with Telegram Bots
MIT License
673 stars 116 forks source link

How to get updates from webhook? #309

Closed Odilbukh closed 1 year ago

Odilbukh commented 1 year ago

I have created telelgram bot, installed webhook and added chat as writen in documentation

https://defstudio.github.io/telegraph/quickstart/new-bot/

So how to get data that comes from bot? How to get updates from webhook? Maybe I need add some routes?

fabio-ivona commented 1 year ago

Hi! You can either set up a webook (if you have an https domain) or use the get updates method of your bot

tobya commented 1 year ago

Production

When in production, you can use the command line tools that Telegraph provide. Details are here https://defstudio.github.io/telegraph/quickstart/setting-webhook

Development

If you wish to develop locally, you can use a service that will forward the webhook calls to your local machine. I first did this with ngrok, but now I use HookDeck which works great.

Set up HookDeck then set the telgram webhook api with by visiting the following url

https://api.telegram.org/bot{YourBotIDFromTelegraphDBorBotFatehr}/setWebhook?url={YourHookDeckURL}/telegraph/{yourbotid}/webhook