Actions13
Overview
This node enables sending files through the Telegram MTProto Client API. It allows users to send any type of file to a specified chat or channel on Telegram by providing the file path or URL and the target chat identifier. This operation is useful for automating file sharing in Telegram groups, channels, or direct chats.
Common scenarios include:
- Automatically sending reports, images, or documents to a team chat.
- Distributing media files like PDFs or presentations to subscribers of a Telegram channel.
- Sharing logs or backups with a support group.
Example: Sending a PDF report file located at a URL to a project management Telegram group by specifying the group's chat ID and the file URL.
Properties
Name | Meaning |
---|---|
Chat ID | The unique identifier or username of the chat/channel where the file will be sent (e.g., @username or -100xxxx). |
File Path Or URL | The local path or web URL of the file to send. |
Options | Additional settings for sending the file: |
- Silent | Send the message silently without notification (boolean). |
- Caption | Caption text to accompany the file message (string). |
- Parse Mode | How to parse the caption text; options are None, Markdown, or HTML. |
- Limit | (Not applicable for this operation but present in options collection) |
Output
The output JSON object contains information about the result of the file sending operation:
success
(boolean): Indicates if the file was sent successfully.messageId
(number): The unique identifier of the sent message.date
(string/timestamp): The date/time when the message was sent.filePath
(string): The original file path or URL used to send the file.
If the node supports binary data output, it would represent the actual file content or metadata, but in this case, the output focuses on metadata about the sent message.
Dependencies
- Requires an active Telegram MTProto API client connection using valid credentials including an API ID, API hash, and session string.
- The node depends on the Telegram MTProto protocol and uses WebSocket Secure (WSS) connections.
- Proper n8n credential configuration is necessary to provide the required authentication details.
Troubleshooting
- No credentials provided: The node will throw an error if the Telegram API credentials are missing or invalid. Ensure that the API ID, API hash, and session are correctly configured.
- Invalid Chat ID: If the chat ID or username is incorrect or inaccessible, the file sending will fail. Verify the chat identifier format and permissions.
- File not found or inaccessible: If the file path or URL is invalid or unreachable, the operation will error out. Confirm the file location and network access.
- Silent option not working as expected: Some Telegram clients may not fully respect silent messages depending on user settings.
- Caption parsing issues: If the caption contains unsupported formatting or characters, try changing the parse mode or simplifying the caption.
- Connection errors: Network issues or Telegram server problems can cause connection failures. Retrying or checking network connectivity may help.