telegram api method · layer 229 · #4423e6c5
messages.getHistory
Returns the conversation history with one interlocutor / within a chat
definition
messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
parameters
| name | type | description |
|---|---|---|
peer | InputPeer | Target peer |
offset_id | int | Only return messages starting from the specified message ID |
offset_date | int | Only return messages sent before the specified date |
add_offset | int | Number of list elements to be skipped, negative values are also accepted. |
limit | int | Number of results to return |
max_id | int | If a positive value was transferred, the method will return only messages with IDs less than max_id |
min_id | int | If a positive value was transferred, the method will return only messages with IDs more than min_id |
hash | long | Result hash |
returns
errors (11)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection. |
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 400 | CHAT_ID_INVALID | The provided chat id is invalid. |
| 400 | CHAT_NOT_MODIFIED | No changes were made to chat information because the new information you passed is identical to the current information. |
| 400 | FROZEN_PARTICIPANT_MISSING | The current account is frozen, and cannot access the specified peer. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | TAKEOUT_INVALID | The specified takeout ID is invalid. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 406 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
history
present in layers 2–229 · constructor id changed 4×
| id | layers |
|---|---|
| #92a1df2f | 2–23 |
| #8a8ec2da | 46 |
| #afa92846 | 62–71 |
| #dcbb8260 | 72–132 |
| #4423e6c5 | 133–229 |