synology-chat-bots

N8N community node for Synology Chat Bot integration - List channels and read messages

Package Information

Downloads: 4 weekly / 77 monthly
Latest Version: 1.5.2
Author: Abdurrahim CEYLAN

Documentation

N8N Synology Chat Bots Node / N8N Synology Chat Bot Düğümü

Bu N8N node'u, Synology Chat API'sini kullanarak kanal listesi alma, mesaj okuma ve mesaj gönderme işlevlerini sağlar.

This N8N node provides channel listing, message reading, and message sending functionality using the Synology Chat API.

🆕 v1.5.2 Yenilik / New Feature: Artık mesajlara dosya ekleme desteği! File URL parametresi ile hem kanal hem de kullanıcı mesajlarına dosya ekleyebilirsiniz.

Now supports file attachments! You can attach files to both channel and user messages using the File URL parameter.

Özellikler / Features

  • Kanal Listesi / Channel List: Synology Chat'teki tüm kanalları listeler / Lists all channels in Synology Chat
  • Mesaj Okuma / Message Reading: Belirtilen kanaldan mesajları okur / Reads messages from specified channel
  • Mesaj Gönderme / Message Sending: Kullanıcılara ve kanallara mesaj gönderir / Sends messages to users and channels
  • Dosya Eki Desteği / File Attachment Support: Mesajlara dosya URL'si ile dosya ekleme / Attach files to messages using file URLs
  • Güvenli Kimlik Doğrulama / Secure Authentication: API token ile güvenli bağlantı / Secure connection with API token

Kurulum / Installation

npm install n8n-nodes-synology-chat-bots

Kullanım / Usage

1. Credentials Ayarlama / Setting Up Credentials

Türkçe:
N8N'de yeni bir credential oluşturun:

  • Type: Synology Chat API
  • Synology URL: Synology NAS URL'iniz (örn: https://your-synology.com:5001)
  • API Token: Synology Chat API token'ınız

English:
Create a new credential in N8N:

  • Type: Synology Chat API
  • Synology URL: Your Synology NAS URL (e.g., https://your-synology.com:5001)
  • API Token: Your Synology Chat API token

⚠️ Önemli Not: Token Gereksinimleri / Important Note: Token Requirements

Türkçe:
Synology Chat'te farklı işlevler için farklı token'lar gereklidir:

  1. Bot Token: Kullanıcılara mesaj gönderme için
  2. Channel Webhook Token: Kanallara mesaj gönderme için

Her iki token'ı da Synology Chat yönetim panelinden ayrı ayrı almanız gerekmektedir.

English:
Different tokens are required for different functions in Synology Chat:

  1. Bot Token: For sending messages to users
  2. Channel Webhook Token: For sending messages to channels

You need to obtain both tokens separately from the Synology Chat management panel.

2. Node Kullanımı / Node Usage

Kanal Listesi Alma / Getting Channel List

Türkçe:

  1. Workflow'unuza "Synology Chat Bot" node'unu ekleyin
  2. Resource olarak "Channel" seçin
  3. Operation olarak "Get List" seçin
  4. Node'u çalıştırın

English:

  1. Add "Synology Chat Bot" node to your workflow
  2. Select "Channel" as Resource
  3. Select "Get List" as Operation
  4. Run the node

Kanala Mesaj Gönderme / Sending Message to Channel

Türkçe:

  1. Workflow'unuza "Synology Chat Bot" node'unu ekleyin
  2. Resource olarak "Channel" seçin
  3. Operation olarak "Send Message" seçin
  4. Message Text alanına göndermek istediğiniz mesajı yazın
  5. (Opsiyonel) File URL alanına eklemek istediğiniz dosyanın URL'sini girin
  6. Node'u çalıştırın

English:

  1. Add "Synology Chat Bot" node to your workflow
  2. Select "Channel" as Resource
  3. Select "Send Message" as Operation
  4. Enter your message in the Message Text field
  5. (Optional) Enter the URL of the file you want to attach in the File URL field
  6. Run the node

Mesaj Okuma / Reading Messages

Türkçe:

  1. Workflow'unuza "Synology Chat Bot" node'unu ekleyin
  2. Resource olarak "Message" seçin
  3. Operation olarak "Get Posts" seçin
  4. Channel ID'yi girin
  5. Next Count ve Previous Count değerlerini ayarlayın
  6. (Opsiyonel) Post ID girin (boş bırakılırsa en yeni mesajdan başlar)
  7. Message Filter ile okunan/okunmayan mesajları filtreleyin
  8. Node'u çalıştırın

English:

  1. Add "Synology Chat Bot" node to your workflow
  2. Select "Message" as Resource
  3. Select "Get Posts" as Operation
  4. Enter the Channel ID
  5. Set Next Count and Previous Count values
  6. (Optional) Enter Post ID (if left empty, starts from the newest message)
  7. Filter read/unread messages with Message Filter
  8. Run the node

Mesaj Gönderme / Sending Messages

Türkçe:

  1. Workflow'unuza "Synology Chat Bot" node'unu ekleyin
  2. Resource olarak "Message" seçin
  3. Operation olarak "Send Message" seçin
  4. Message Text alanına göndermek istediğiniz mesajı yazın
  5. User IDs alanına hedef kullanıcı ID'lerini virgülle ayırarak girin (örn: "5,287")
  6. (Opsiyonel) File URL alanına eklemek istediğiniz dosyanın URL'sini girin
  7. Node'u çalıştırın

English:

  1. Add "Synology Chat Bot" node to your workflow
  2. Select "Message" as Resource
  3. Select "Send Message" as Operation
  4. Enter your message in the Message Text field
  5. Enter target user IDs separated by commas in the User IDs field (e.g., "5,287")
  6. (Optional) Enter the URL of the file you want to attach in the File URL field
  7. Run the node

📎 Dosya Eki Desteği (v1.5.0+) / File Attachment Support (v1.5.0+)

Türkçe:
Bu node artık mesajlara dosya ekleme desteği sunar:

Dosya URL'si Kullanımı / File URL Usage

  • File URL: Eklenecek dosyanın tam URL'sini girin / Enter the full URL of the file to be attached
  • Desteklenen Formatlar / Supported Formats: Tüm web erişilebilir dosya türleri / All web-accessible file types
  • Örnek URL'ler / Example URLs:
    • https://example.com/files/document.pdf
    • https://your-synology.com:5001/shared/folder/image.jpg
    • https://drive.google.com/file/d/123456789/view

Dosya Eki Özellikleri / File Attachment Features

  • Kanal Mesajları / Channel Messages: Kanallara dosya ekli mesaj gönderme / Send file-attached messages to channels
  • Kullanıcı Mesajları / User Messages: Kullanıcılara dosya ekli mesaj gönderme / Send file-attached messages to users
  • Opsiyonel / Optional: File URL boş bırakılırsa sadece metin mesajı gönderilir / If File URL is left empty, only text message is sent
  • Güvenli / Secure: Synology Chat API'si üzerinden güvenli dosya paylaşımı / Secure file sharing through Synology Chat API

Dosya Eki Kullanım Örnekleri / File Attachment Usage Examples

Türkçe:

// Kanal mesajına dosya ekleme
{
  "text": "İşte rapor dosyası",
  "file_url": "https://your-synology.com/shared/reports/monthly-report.pdf"
}

// Kullanıcı mesajına dosya ekleme
{
  "text": "Toplantı notları",
  "user_ids": [5, 287],
  "file_url": "https://example.com/meeting-notes.docx"
}

English:

// Attaching file to channel message
{
  "text": "Here is the report file",
  "file_url": "https://your-synology.com/shared/reports/monthly-report.pdf"
}

// Attaching file to user message
{
  "text": "Meeting notes",
  "user_ids": [5, 287],
  "file_url": "https://example.com/meeting-notes.docx"
}

API Endpoints

Kanal Listesi / Channel List

GET /webapi/entry.cgi?api=SYNO.Chat.External&method=channel_list&version=2&token={token}

Mesaj Listesi / Message List

GET /webapi/entry.cgi?api=SYNO.Chat.External&method=post_list&version=2&token={token}&channel_id={channel_id}&next_count={next_count}&prev_count={prev_count}&post_id={post_id}&filter={filter}

Parametreler / Parameters:

  • post_id (opsiyonel / optional): Belirli bir post'tan başlamak için / To start from a specific post
  • filter (opsiyonel / optional): "read", "unread" veya boş (tüm mesajlar) / "read", "unread" or empty (all messages)

Mesaj Gönderme (Kullanıcılara) / Send Message (To Users)

GET /webapi/entry.cgi?api=SYNO.Chat.External&method=chatbot&version=2&token={token}&payload={"text": "message text", "user_ids": [5, 287], "file_url": "https://example.com/file.pdf"}

Mesaj Gönderme (Kanala) / Send Message (To Channel)

GET /webapi/entry.cgi?api=SYNO.Chat.External&method=incoming&version=2&token={token}&payload={"text": "message text", "file_url": "https://example.com/file.pdf"}

Dosya Eki Parametreleri / File Attachment Parameters:

  • file_url (opsiyonel / optional): Eklenecek dosyanın URL'si / URL of the file to be attached
  • Desteklenen formatlar / Supported formats: PDF, DOC, XLS, JPG, PNG, MP4, vb. / PDF, DOC, XLS, JPG, PNG, MP4, etc.
  • URL'nin web'den erişilebilir olması gerekir / URL must be web-accessible

Geliştirme / Development

Türkçe:

# Bağımlılıkları yükle
npm install

# TypeScript'i derle
npm run build

# Linting
npm run lint

# Formatting
npm run format

English:

# Install dependencies
npm install

# Compile TypeScript
npm run build

# Linting
npm run lint

# Formatting
npm run format

Lisans / License

MIT

Katkıda Bulunma / Contributing

Türkçe:

  1. Fork yapın
  2. Feature branch oluşturun (git checkout -b feature/amazing-feature)
  3. Commit yapın (git commit -m 'Add some amazing feature')
  4. Push yapın (git push origin feature/amazing-feature)
  5. Pull Request oluşturun

English:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Create a Pull Request

Destek / Support

Türkçe:
Sorunlar için GitHub Issues kullanın.

English:
Use GitHub Issues for reporting problems.

Changelog / Değişiklik Geçmişi

v1.5.2 (2024-12-19)

  • Yeni / New: Dosya eki desteği eklendi / File attachment support added
  • Yeni / New: File URL parametresi hem kanal hem kullanıcı mesajları için / File URL parameter for both channel and user messages
  • Güncelleme / Update: NPM bağımlılıkları en son versiyonlara güncellendi / NPM dependencies updated to latest versions
  • Güncelleme / Update: TypeScript 5.3.0'a güncellendi / Updated to TypeScript 5.3.0

v1.4.0

  • Kanal listesi alma / Channel listing
  • Mesaj okuma / Message reading
  • Mesaj gönderme / Message sending
  • Güvenli kimlik doğrulama / Secure authentication

Discussion