Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Message → Send Message with Document

AI-generated

Overview

This node operation sends a document message to a specified Telegram chat. It allows users to upload a local file as a document and optionally add a caption and reply to a specific message within the chat. This is useful for automating the sharing of documents in Telegram chats, such as sending reports, PDFs, or other file types directly from a local path.

Use Case Examples

  1. Automate sending monthly reports as documents to a team chat.
  2. Send user-uploaded documents to a customer support chat automatically.

Properties

Name Meaning
Chat ID The identifier of the Telegram chat where the document will be sent.
Message File (Photo, Video, Document) The local file path of the document to be sent.
Caption Optional caption text to accompany the document message.
Reply to messageId Optional message ID to which this document message will reply.

Output

JSON

  • _ - Type of the sent message, e.g., 'sendMessage'
  • chat_id - ID of the chat where the message was sent
  • reply_to_message_id - ID of the message this message is replying to, if any
  • input_message_content
    • _ - Type of input message content, here 'inputMessageDocument'
    • document
      * _ - Indicates the document file is a local file with its path
      * path - Local file path of the document sent
    • caption
      * _ - Caption text format, e.g., 'formattedText'
      * text - Caption text accompanying the document message

Dependencies

  • Telegram API access via an API key credential

Troubleshooting

  • Ensure the Telegram API credentials are valid and the session is logged in; otherwise, the node will throw login-related errors.
  • Verify the local file path is correct and accessible to avoid file not found errors.
  • If the caption is empty, it is set to null to avoid sending empty captions.
  • Common errors include 'Unauthorized' or 'A closed client cannot be reused' which indicate session issues requiring re-login.

Links

Discussion