Telegram CoPilot icon

Telegram CoPilot

Your Personal Telegram CoPilot

Chat → Get Chat History

AI-generated

Overview

This node interacts with the Telegram API to perform various chat-related operations. Specifically, the 'Get Chat History' operation fetches the message history from a specified chat starting from a given message ID. This is useful for retrieving past conversations, analyzing chat content, or archiving messages. For example, a user can fetch the latest messages from a group chat or a private chat by providing the chat ID and the starting message ID.

Use Case Examples

  1. Retrieve the last message in a chat by setting 'From Message ID' to 0.
  2. Fetch 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 message history.
From Message ID The message ID from which to start fetching the chat history. Use 0 to start from the latest message.

Output

JSON

  • ``
    • id - The unique identifier of each message in the chat history.
    • message - The content of each message retrieved from the chat history.
    • date - The timestamp when each message was sent.
    • from_id - The identifier of the user who sent the message.

Dependencies

  • Telegram API access via an API key credential
  • TelePilot API credentials (apiId, apiHash, phoneNumber)

Troubleshooting

  • Ensure the Telegram API credentials are correctly configured and the user is logged in; otherwise, the node will throw an error indicating the session is closed or unauthorized.
  • If the chat ID is invalid or the user does not have permission to access the chat, the node may throw an error or return empty results.
  • The 'From Message ID' should be a valid message identifier; using an invalid ID may result in no messages being returned.
  • Network issues or Telegram API rate limits may cause temporary failures; retrying the operation may help.

Links

Discussion