telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

WebHooks not working 😠

Open hardskulls opened this issue 1 year ago • 2 comments

When I use

webhook, err := tgbotapi.NewWebhook(host + ":" + port + "/" + bot.Token)
updates := bot.ListenForWebhook("/" + bot.Token)

(took it from docs) it doesn't work at all, (tested locally with ngrok and localtunnel, ngrok doesn't even get anything) , but when I use this (currently on heroku):

webhook, err := tgbotapi.NewWebhook(host + bot.Token)
updates := bot.ListenForWebhook("/" + bot.Token)

it works just fine.

Is it a bug, or did I miss something in the docs?

hardskulls avatar Nov 03 '22 16:11 hardskulls

Hey @hardskulls !

If you use ngrok, for example it gives you https://ee84-20-20-20.eu.ngrok.io, just use

webhook, err := tgbotapi.NewWebhook("https://ee84-20-20-20.eu.ngrok.io/" + bot.Token)

k2589 avatar Jan 14 '23 11:01 k2589