From 2bb394623713e422fff94dbc3f2ee7cd963a1c5d Mon Sep 17 00:00:00 2001 From: astravexton Date: Sun, 29 Jun 2025 18:35:01 +0100 Subject: [PATCH] add env var for endpoint --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 36e4d8a..8f8e462 100644 --- a/main.go +++ b/main.go @@ -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) }