add env var for endpoint
All checks were successful
/ build (push) Successful in 55s

This commit is contained in:
Astra 2025-06-29 18:35:01 +01:00
parent e0a63bd7d5
commit 2bb3946237

View file

@ -72,7 +72,11 @@ func main() {
log.Fatalf("failed to create client: %v", err)
}
bot, err := tgbotapi.NewBotAPIWithAPIEndpoint(os.Getenv("TG_TOKEN"), "https://bot.astra.blue/bot%s/%s")
endpoint := "https://api.telegram.org/bot%s/%s"
if os.Getenv("TG_API_ENDPOINT") != "" {
endpoint = os.Getenv("TG_API_ENDPOINT")
}
bot, err := tgbotapi.NewBotAPIWithAPIEndpoint(os.Getenv("TG_TOKEN"), endpoint)
if err != nil {
panic(err)
}