Telegram CoPilot icon

Telegram CoPilot

袙邪褕 锌械褉褋芯薪邪谢褜薪褘泄 Telegram CoPilot

Actions56

小芯芯斜褖械薪懈械 → 袨褌锌褉邪胁懈褌褜 褋芯芯斜褖械薪懈械 褋 褎邪泄谢芯屑

AI-generated

Overview

This node operation sends a file message to a specified Telegram chat. It allows users to upload a local file to the chat with an optional caption and supports setting a self-destruct timer for the file message. This is useful for automating file sharing in Telegram chats, such as sending documents, images, or other media files programmatically.

Use Case Examples

  1. Automatically send a PDF report to a Telegram group chat every morning.
  2. Share a photo with a caption to a chat and have it self-destruct after a set time.

Properties

Name Meaning
Chat ID The unique identifier of the Telegram chat where the file will be sent.
File Path The local file system path to the file that will be sent to the chat.
File Caption An optional text caption to accompany the file message.
袙褉械屑褟 褋邪屑芯褍薪懈褔褌芯卸械薪懈褟 (胁 褋械泻褍薪写邪褏) Self-destruct timer in seconds for the file message. If set greater than 0, the file message will automatically delete after the specified time. 0 means no self-destruct.
Reply to threadID If not 0, specifies the message thread ID in which the file message will be sent as a reply.
Reply to messageId Identifier of the message to which this file message is a reply.

Output

JSON

  • _ - Type of the Telegram API method invoked, e.g., 'sendMessage'.
  • chat_id - The chat ID where the file was sent.
  • reply_to_msg_id - The message ID this file message is replying to, if any.
  • message_thread_id - The thread ID within the chat where the message was sent, if applicable.
  • input_message_content
    • _ - The type of input message content, here it is 'inputMessageDocument' indicating a file document.
    • document
      * _ - Indicates the file is a local input file.
      * path - The local file path of the file sent.
    • caption
      * _ - Caption type, typically 'formattedText'.
      * text - The caption text for the file message.
    • self_destruct_type
      * _ - If set, indicates the self-destruct timer type.
      * self_destruct_time - The self-destruct time in seconds for the file message.

Dependencies

  • An API key credential for Telegram API authentication

Troubleshooting

  • Ensure the file path is correct and the file exists locally before sending.
  • If the self-destruct time is set, verify that the Telegram client supports this feature.
  • Common errors include 'Client is not initialized' if the Telegram client session is not active; re-login may be required.
  • Errors related to permissions or invalid chat IDs may occur if the chat ID is incorrect or the bot/user lacks permission to send messages.

Links

Discussion