package telegram import ( "fmt" "net/http" ) type Handlers struct { client *Client chatID int64 } func NewHandlers(client *Client, chatID int64) *Handlers { return &Handlers{ client: client, chatID: chatID, } } func (h *Handlers) HandleFragment(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") var content string var statusBadge string var openAttr string if h.client == nil { statusBadge = `Not Configured` content = `
Setup Instructions:
/newbot and follow the prompts.env: TELEGRAM_BOT_TOKEN=your-token.env: TELEGRAM_CHAT_ID=your-chat-idSee full setup guide
` openAttr = " open" } else { bot, err := h.client.GetMe() if err != nil { statusBadge = `Error` content = fmt.Sprintf(`Error: %s
`, err) openAttr = " open" } else if h.chatID == 0 { statusBadge = fmt.Sprintf(`Needs Chat ID@%s`, bot.Username) content = `Complete Setup:
.env: TELEGRAM_CHAT_ID=your-chat-idUnlink Instructions:
TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID from .envdocker compose restart prism