Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Overview

The Send Message with Photo operation of the "Message" resource in this custom n8n node allows you to send a photo (image file) as a message to a specified Telegram chat. This is particularly useful for automating notifications, sending images from workflows, or integrating Telegram messaging into business processes. For example, you could use this node to automatically send product images to a support group, share screenshots from monitoring systems, or deliver photos captured by IoT devices directly to a Telegram channel or user.

Properties

Below are the input properties relevant to the "Send Message with Photo" operation:

Display Name Type Description
Chat ID String ID of the target chat where the photo will be sent. Example: 122323. Required.
Message Photo String Local path to the image file to be sent. Example: /tmp/my-pic.png. Required.
Photo Caption String Optional caption text to accompany the photo.
Reply to messageId String (Optional) Identifier of the message to reply to.

Output

The output of this operation is a JSON object representing the result of the Telegram API's sendMessage call with a photo. The structure typically includes:

{
  "_": "message",
  "id": <number>,
  "chat_id": <number>,
  "date": <timestamp>,
  "content": {
    "_": "messagePhoto",
    "photo": { /* photo details */ },
    "caption": { "_": "formattedText", "text": "<caption text>" }
  },
  // ...other Telegram message fields
}
  • The output contains all standard Telegram message fields, including message ID, chat ID, date, and content.
  • The content field will specifically indicate that it is a messagePhoto, containing details about the photo and its caption.
  • No binary data is returned; only metadata and references to the sent photo.

Dependencies

  • External Service: Requires access to the Telegram API via the TelePilot integration.
  • Credentials: You must configure and provide valid telePilotApi credentials in n8n, which include your Telegram API ID, API Hash, and phone number.
  • File Access: The node must have read access to the local file system path specified in "Message Photo".

Troubleshooting

Common Issues:

  • Invalid Chat ID: If the provided Chat ID is incorrect or the bot/user does not have permission to post in the chat, the operation will fail.
  • File Not Found: If the file at the specified "Message Photo" path does not exist or is inaccessible, an error will occur.
  • Session/Authorization Errors: If the Telegram session is closed or unauthorized, you may see errors prompting you to log in again.
  • Caption Issues: If the caption is too long or contains unsupported characters, Telegram may reject the message.

Error Messages and Resolutions:

  • "File not found at path: ...": Ensure the file exists and the path is correct and accessible by the n8n process.
  • "Please login: https://telepilot.co/login-howto": Re-authenticate your Telegram account using the provided guide.
  • "Session was closed or terminated. Please login again: ...": Your session expired; follow the login instructions.
  • "Cannot send messages to this chat. You may not have permission.": Check if the bot/user has rights to post in the target chat.

Links and References


This summary provides a clear understanding of how to use the "Send Message with Photo" operation, what to expect as output, and how to resolve common issues.

Discussion