I use go-telegram-bot-api for building a Telegram Bot and deploying it on Heroku.
I need to set Webhooks as I used to do in Python like in this Python case.
Can't understand how to set Webhooks in go-telegram-bot-api without providing certificate files.
The main example contains such lines:
If you need to use webhooks (if you wish to run on Google App Engine), you may use a slightly different method.
package main
import (
"gopkg.in/telegram-bot-api.v4"
"log"
"net/http"
)
func main() {
bot, err := tgbotapi.NewBotAPI("MyAwesomeBotToken")
if err != nil {
log.Fatal(err)
}
bot.Debug = true
log.Printf("Authorized on account %s", bot.Self.UserName)
_, err = bot.SetWebhook(tgbotapi.NewWebhookWithCert("https://www.google.com:8443/"+bot.Token, "cert.pem"))
if err != nil {
log.Fatal(err)
}
updates := bot.ListenForWebhook("/" + bot.Token)
go http.ListenAndServeTLS("0.0.0.0:8443", "cert.pem", "key.pem", nil)
for update := range updates {
log.Printf("%+v\n", update)
}
}
But using Heroku for deploying how could I listen to Webhooks without providing pem certificate files?