Actions26
- Chat Actions
- File Actions
- Group Actions
- Message Actions
- User Actions
Chat → Get Chat History
AI-generatedOverview
This node, named "Telegram CoPilot," provides extensive interaction capabilities with the Telegram platform via its API. Specifically, for the Chat resource and the Get Chat History operation, it fetches a segment of message history from a specified chat. This is useful for scenarios where you want to retrieve past messages for analysis, backup, or processing within an automation workflow.
Practical examples include:
- Archiving recent messages from a group or private chat.
- Monitoring chat activity by fetching recent messages.
- Integrating Telegram chat history into other systems like CRM or analytics platforms.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The unique identifier of the chat from which to fetch the message history. |
| From Message ID | The message ID to start fetching history from; use 0 to start from the latest message. |
| Limit | Maximum number of messages to return (minimum 1). |
| Offset | Offset relative to From Message ID; 0 starts exactly at that message, negative values (up to -99) include newer messages. |
Output
The output is a JSON array containing the fetched chat history messages. Each element corresponds to a message object as returned by the Telegram API, including details such as message content, sender, timestamp, and message identifiers.
No binary data output is indicated for this operation.
Dependencies
- Requires an active Telegram API authentication token (API key credential).
- The node depends on a connection manager that handles Telegram client sessions.
- Proper login/authentication must be established before using this operation.
- No additional external services are required beyond Telegram's API.
Troubleshooting
Common Issues:
- Attempting to fetch chat history without being logged in will result in errors prompting re-authentication.
- Providing invalid or non-existent Chat IDs or Message IDs may cause empty results or errors.
- Using offsets outside the allowed range (-99 to 0) may lead to unexpected behavior.
Error Messages:
"Session was closed or terminated. Please login again": Indicates the Telegram session expired or was closed; re-login is necessary."Please login": Authentication is missing or invalid; ensure the Telegram API credentials are correctly configured and the user is logged in.- Errors related to unauthorized access typically mean the API token lacks permissions or the session is invalid.
Links and References
- Telegram API Documentation
- Telepilot Login Guide (for setting up and troubleshooting authentication)
- Telegram Bot API (general reference for message and chat structures)