func (b *Bot) StartWebhookServerAndWait(certFilepath string, keyFilepath string, webhookHandler func(b *Bot, webhook Update, err error)) {
	b.verbose("starting webhook server on: %s (port: %d) ...", b.getWebhookPath(), b.webhookPort)

	// set update handler
	if webhookHandler == nil {
		b.error("given webhook handler is nil")
		return
	}
	b.updateHandler = webhookHandler

	// routing
	mux := http.NewServeMux()
	mux.HandleFunc(b.getWebhookPath(), b.handleWebhook)

	// start server
	server := &http.Server{
		Addr:              fmt.Sprintf(":%d", b.webhookPort),
		Handler:           mux,
		ReadTimeout:       10 * time.Second,
		ReadHeaderTimeout: 10 * time.Second,
		WriteTimeout:      10 * time.Second,
		IdleTimeout:       60 * time.Second,
	}
	if err := server.ListenAndServeTLS(certFilepath, keyFilepath); err != nil {
		panic(err.Error())
	}
}
// StartWebhookServerAndWait starts a webhook server(and waits forever).
// Function SetWebhook(host, port, certFilepath) should be called priorly to setup host, port, and certification file.
// Certification file(.pem) and a private key is needed.
// Incoming webhooks will be received through webhookHandler function.
//
// https://core.telegram.org/bots/self-signed
StartWebhookServerAndWait starts a webhook server(and waits forever).
Function SetWebhook(host, port, certFilepath) should be called priorly to setup host, port, and certification file.
Certification file(.pem) and a private key is needed.
Incoming webhooks will be received through webhookHandler function.

core.telegram.org/bots/self-signed
// StartWebhookServerAndWait starts a webhook server ( and waits forever ) . // Function SetWebhook ( host port certFilepath ) should be called priorly to setup host port and certification file . // Certification file ( . pem ) and a private key is needed . // Incoming webhooks will be received through webhookHandler function . // // https : // core . telegram . org / bots / self - signed
func (b *Bot) StartWebhookServerAndWait(certFilepath string, keyFilepath string, webhookHandler func(b *Bot, webhook Update, err error)) {
	b.verbose("starting webhook server on: %s (port: %d) ...", b.getWebhookPath(), b.webhookPort)
	if webhookHandler == nil {
		b.error("given webhook handler is nil")
		return
	}
	b.updateHandler = webhookHandler
	mux := http.NewServeMux()
	mux.HandleFunc(b.getWebhookPath(), b.handleWebhook)
	server := &http.Server{
		Addr:              fmt.Sprintf(":%d", b.webhookPort),
		Handler:           mux,
		ReadTimeout:       10 * time.Second,
		ReadHeaderTimeout: 10 * time.Second,
		WriteTimeout:      10 * time.Second,
		IdleTimeout:       60 * time.Second,
	}
	if err := server.ListenAndServeTLS(certFilepath, keyFilepath); err != nil {
		panic(err.Error())
	}
}
func ( b * Bot ) StartWebhookServerAndWait ( certFilepath string , keyFilepath string , webhookHandler func ( b * Bot , webhook Update , err error ) ) { b . verbose ( " " , b . getWebhookPath ( ) , b . webhookPort ) if webhookHandler == nil { b . error ( " " ) return } b . updateHandler = webhookHandler mux := http . NewServeMux ( ) mux . HandleFunc ( b . getWebhookPath ( ) , b . handleWebhook ) server := & http . Server { Addr : fmt . Sprintf ( " " , b . webhookPort ) , Handler : mux , ReadTimeout : 10 * time . Second , ReadHeaderTimeout : 10 * time . Second , WriteTimeout : 10 * time . Second , IdleTimeout : 60 * time . Second , } if err := server . ListenAndServeTLS ( certFilepath , keyFilepath ) ; err != nil { panic ( err . Error ( ) ) } }
StartWebhookServerAndWait starts a webhook server(and waits forever).
StartWebhookServerAndWait starts a webhook server ( and waits forever ) .
// set update handler // routing // start server