diff --git a/internal/notification/telegram.go b/internal/notification/telegram.go index a07b6ca..1eb5b21 100644 --- a/internal/notification/telegram.go +++ b/internal/notification/telegram.go @@ -73,7 +73,15 @@ func (s *telegramSender) Send(event domain.NotificationEvent, payload domain.Not return errors.Wrap(err, "could not marshal data: %+v", m) } - url := fmt.Sprintf("https://api.telegram.org/bot%v/sendMessage", s.Settings.Token) + var host string + + if s.Settings.Host == "" { + host = "https://api.telegram.org" + } else { + host = s.Settings.Host + } + + url := fmt.Sprintf("%v/bot%v/sendMessage", host, s.Settings.Token) req, err := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(jsonData)) if err != nil { diff --git a/web/src/forms/settings/NotificationForms.tsx b/web/src/forms/settings/NotificationForms.tsx index 30b5a9f..da35165 100644 --- a/web/src/forms/settings/NotificationForms.tsx +++ b/web/src/forms/settings/NotificationForms.tsx @@ -132,6 +132,12 @@ function FormFieldsTelegram() { label="Message Thread ID" help="Message Thread (topic) of a Supergroup" /> + ); }