TelegramUser icon

TelegramUser

Interact with Telegram as a user

Actions2

Overview

This node allows interaction with Telegram as a user, specifically to retrieve messages from a specified chat. It is useful for automating workflows that require reading message history from Telegram chats, such as monitoring conversations, extracting data from chat messages, or integrating Telegram messages into other systems.

A practical example would be fetching the last 50 messages from a customer support chat to analyze customer inquiries or to trigger further processing based on message content.

Properties

Name Meaning
Chat The username (without @) or chat ID of the Telegram chat from which to get messages.
Limit Maximum number of messages to return. Must be at least 1. Defaults to 50.

Output

The output JSON contains the following fields:

  • chat: The chat identifier (username or chat ID) from which messages were retrieved.
  • messagesCount: Number of messages returned.
  • messages: An array of message objects, each containing:
    • id: Unique identifier of the message.
    • message: Text content of the message.
    • date: Timestamp when the message was sent.
    • sender: Sender's ID as a string (if available).
    • media: Boolean indicating whether the message contains media.

No binary data output is produced by this operation.

Dependencies

  • Requires an API authentication token credential for Telegram user access.
  • Uses an internal helper class to authenticate and interact with the Telegram client.
  • No additional external services beyond Telegram itself are required.

Troubleshooting

  • Authentication failures: Errors during authentication will throw messages like "Authentication failed: ...". Ensure the provided API credentials are valid and have proper permissions.
  • Client initialization errors: If the Telegram client fails to initialize, the error "Failed to initialize Telegram client" may appear. This could indicate issues with the session or network connectivity.
  • Invalid chat identifiers: Providing an incorrect or inaccessible chat username/ID may result in empty results or errors.
  • Limit parameter issues: Setting the limit below 1 will not be accepted; ensure it is a positive integer.

To resolve these issues, verify credentials, check chat identifiers, and confirm network connectivity.

Links and References

Discussion