get_messages
Retrieve historical messages from a Telegram chat. Filter by user, time range, or message IDs for paginated access.
Instructions
读取某个对话的历史消息,默认从最新往回取。
Args:
chat: 对话(ID / @username / 'me')。
limit: 条数上限,最多 200。
offset_id: 从该消息 ID 之前开始取(分页用)。
min_id: 只取 ID 大于它的消息。
max_id: 只取 ID 小于它的消息。
from_user: 只看某个发送者的消息。
reverse: True 则按时间正序(从旧到新)。
topic_id: 话题群里只看某个话题(用 get_forum_topics 拿 ID)。
before: 只取该时间点之前的消息,ISO8601 / Unix 时间戳 / 相对时间(如 +0s 表示现在)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | Yes | ||
| limit | No | ||
| before | No | ||
| max_id | No | ||
| min_id | No | ||
| reverse | No | ||
| topic_id | No | ||
| from_user | No | ||
| offset_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |