mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Add Telegram integration
This commit is contained in:
parent
93596c1218
commit
34dd358eb0
25 changed files with 173 additions and 4 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"miniflux.app/integration/nunuxkeeper"
|
||||
"miniflux.app/integration/pinboard"
|
||||
"miniflux.app/integration/pocket"
|
||||
"miniflux.app/integration/telegrambot"
|
||||
"miniflux.app/integration/wallabag"
|
||||
"miniflux.app/logger"
|
||||
"miniflux.app/model"
|
||||
|
@ -70,3 +71,15 @@ func SendEntry(entry *model.Entry, integration *model.Integration) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PushEntry pushes new entry to the activated providers.
|
||||
// This function should be wrapped in a goroutine to avoid block of program execution.
|
||||
func PushEntry(entry *model.Entry, integration *model.Integration) {
|
||||
if integration.TelegramBotEnabled {
|
||||
logger.Debug("[Integration] Sending Entry #%d for User #%d to telegram", entry.ID, integration.UserID)
|
||||
err := telegrambot.PushEntry(entry, integration.TelegramBotToken, integration.TelegramBotChatID)
|
||||
if err != nil {
|
||||
logger.Error("[Integration] push entry to telegram bot failed: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue