diff --git a/internal/telegram/telegram.go b/internal/telegram/telegram.go index ee4106d..bbbfc64 100644 --- a/internal/telegram/telegram.go +++ b/internal/telegram/telegram.go @@ -54,8 +54,8 @@ func StartBot() { } if c.Config.Telegram.Webhook.Enabled { - var url *http.URI - url.Parse(nil, []byte(c.Config.Telegram.Webhook.Domain)) + var url http.URI + url.Parse([]byte(c.Config.Telegram.Webhook.Domain), []byte("")) if len(url.Host()) == 0 { log.Fatal().Msg("Can't parse webhook URL: got empty host") } @@ -64,7 +64,7 @@ func StartBot() { webhook := telegram.NewWebhook(url.String()+bot.AccessToken, nil) webhook.MaxConnections = 40 - updates = bot.NewWebhookChannel(url, webhook, "", "", c.Config.Telegram.Webhook.Listen) + updates = bot.NewWebhookChannel(&url, webhook, "", "", c.Config.Telegram.Webhook.Listen) } else { log.Warn().Msg("Using long-polling for updates (not recommended)") var info *telegram.WebhookInfo