mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(notifications): add support for custom Telegram api url (#1508)
feat(notifications): Add support for reverse proxyed telegram api
This commit is contained in:
parent
72ca7a8a4f
commit
c43e2c76d6
2 changed files with 15 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue