title: Telegram Bot API Webhooks with Go, GoLang on Heroku
body: <p>I use <code>go-telegram-bot-api</code> for building a Telegram Bot and deploying it on <strong>Heroku</strong>.</p>
  
  <p>I need to set Webhooks as I used to do in Python like <a href="https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks#heroku" rel="noreferrer">in this Python case</a>.</p>
  
  <p>Can't understand how to set Webhooks in <code>go-telegram-bot-api</code> without providing certificate files.</p>
  
  <p>The main example contains such lines:</p>
  
  <blockquote>
    <p>If you need to use webhooks (if you wish to run on Google App Engine), you may use a slightly different method.</p>
  </blockquote>
  
  <pre><code>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)
      }
  }
  </code></pre>
  
  <p>But <strong>using Heroku for deploying</strong> how could I listen to Webhooks without providing <code>pem</code> certificate files?</p>