mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-28 07:56:30 +01:00
Add Telegram as a notification destination (#30)
Allows notifications to be sent via a Telegram bot to a set of pre defined chat IDs. Messages are simple plain text with the bare minimum information.
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/crazy-max/diun/internal/notif/mail"
|
||||
"github.com/crazy-max/diun/internal/notif/notifier"
|
||||
"github.com/crazy-max/diun/internal/notif/slack"
|
||||
"github.com/crazy-max/diun/internal/notif/telegram"
|
||||
"github.com/crazy-max/diun/internal/notif/webhook"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
@@ -31,6 +32,9 @@ func New(config model.Notif, app model.App) (*Client, error) {
|
||||
if config.Slack.Enable {
|
||||
c.notifiers = append(c.notifiers, slack.New(config.Slack, app))
|
||||
}
|
||||
if config.Telegram.Enable {
|
||||
c.notifiers = append(c.notifiers, telegram.New(config.Telegram, app))
|
||||
}
|
||||
if config.Webhook.Enable {
|
||||
c.notifiers = append(c.notifiers, webhook.New(config.Webhook, app))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user