Actions37
- Chat Actions
- Contact Actions
- File Actions
- Group Actions
- Login Actions
- Message Actions
- Request Actions
- User Actions
Chat → Get Chat History
AI-generatedOverview
This node operation fetches the chat history from a specified Telegram chat. It retrieves messages starting from a given message ID, allowing users to obtain recent or specific segments of chat history. This is useful for scenarios such as archiving conversations, analyzing chat content, or displaying past messages in an application.
Use Case Examples
- Fetching the last message in a chat by setting 'From Message ID' to 0.
- Retrieving chat history starting from a specific message ID to get messages after that point.
Properties
| Name | Meaning |
|---|---|
| Chat ID | The unique identifier of the chat from which to fetch the history. |
| From Message ID | The message ID starting from which the chat history should be fetched; use 0 to get results from the last message. |
Output
JSON
chat_id- The ID of the chat from which the history was fetched.messages- An array of messages retrieved from the chat history.total_count- The total number of messages available in the chat history.
Dependencies
- Requires an API key credential for Telegram via the telePilotApi credential.
Troubleshooting
- If the node throws an 'Unauthorized' error, it indicates that the Telegram session is not logged in or has expired. The user should re-authenticate using the login process.
- If the error 'A closed client cannot be reused, create a new Client' occurs, it means the Telegram client session was closed and needs to be re-established by logging in again.
- Ensure the 'Chat ID' and 'From Message ID' are correctly provided; invalid or missing IDs will cause the operation to fail.
Links
- TelePilot Login Guide - Instructions on how to log in and authenticate the Telegram session for this node.