1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

Add Telegram integration

This commit is contained in:
三三 2021-09-08 11:04:22 +08:00 committed by GitHub
parent 93596c1218
commit 34dd358eb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 173 additions and 4 deletions

View file

@ -68,7 +68,10 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
nunux_keeper_api_key,
pocket_enabled,
pocket_access_token,
pocket_consumer_key
pocket_consumer_key,
telegram_bot_enabled,
telegram_bot_token,
telegram_bot_chat_id
FROM
integrations
WHERE
@ -99,6 +102,9 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) {
&integration.PocketEnabled,
&integration.PocketAccessToken,
&integration.PocketConsumerKey,
&integration.TelegramBotEnabled,
&integration.TelegramBotToken,
&integration.TelegramBotChatID,
)
switch {
case err == sql.ErrNoRows:
@ -137,9 +143,12 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
nunux_keeper_api_key=$19,
pocket_enabled=$20,
pocket_access_token=$21,
pocket_consumer_key=$22
pocket_consumer_key=$22,
telegram_bot_enabled=$23,
telegram_bot_token=$24,
telegram_bot_chat_id=$25
WHERE
user_id=$23
user_id=$26
`
_, err := s.db.Exec(
query,
@ -165,6 +174,9 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error {
integration.PocketEnabled,
integration.PocketAccessToken,
integration.PocketConsumerKey,
integration.TelegramBotEnabled,
integration.TelegramBotToken,
integration.TelegramBotChatID,
integration.UserID,
)