1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-17 04:30:03 +02:00
thalos/app/service/telegram/config.go
2023-03-08 15:52:10 +01:00

21 lines
405 B
Go

package telegram
import (
"github.com/nikoksr/notify"
"github.com/nikoksr/notify/service/telegram"
)
type Config struct {
Id string `json:"id"`
Channel int64 `json:"channel"`
}
func Notifier(conf Config) func() (notify.Notifier, error) {
return func() (notify.Notifier, error) {
tg, err := telegram.New(conf.Id)
if err == nil {
tg.AddReceivers(conf.Channel)
}
return tg, err
}
}