up
This commit is contained in:
@@ -12,8 +12,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/sujit-baniya/fiber-boilerplate/app"
|
||||
"github.com/sujit-baniya/fiber-boilerplate/pkg/models"
|
||||
"github.com/sujit-baniya/fiber-boilerplate/pkg/services"
|
||||
)
|
||||
|
||||
// TelegramIndex renderiza la vista de configuración de Telegram.
|
||||
@@ -222,12 +222,7 @@ func SetPortalWebhook(c *fiber.Ctx) error {
|
||||
return c.Status(404).JSON(fiber.Map{"error": "Configuración no encontrada"})
|
||||
}
|
||||
|
||||
// Construir URL base desde la configuración de la app
|
||||
baseURL := app.Http.Server.Url
|
||||
if len(baseURL) > 0 && baseURL[len(baseURL)-1] == '/' {
|
||||
baseURL = baseURL[:len(baseURL)-1]
|
||||
}
|
||||
webhookURL := baseURL + "/webhooks/telegram-portal"
|
||||
webhookURL := services.GetPublicURL() + "/webhooks/telegram-portal"
|
||||
|
||||
apiURL := fmt.Sprintf("https://api.telegram.org/bot%s/setWebhook", cfg.BotToken)
|
||||
payload, _ := json.Marshal(map[string]string{"url": webhookURL})
|
||||
|
||||
Reference in New Issue
Block a user