MadelineProtoDocs/old_docs/API_docs_v38/methods/channels_getImportantHistory.md

84 lines
2.2 KiB
Markdown
Raw Normal View History

2018-04-01 13:24:46 +02:00
---
title: channels.getImportantHistory
description: Get important channel/supergroup history
2018-04-04 19:52:48 +02:00
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
2018-04-01 13:24:46 +02:00
---
2018-04-05 01:19:57 +02:00
# Method: channels.getImportantHistory
2018-04-01 13:24:46 +02:00
[Back to methods index](index.md)
Get important channel/supergroup history
### Parameters:
2018-08-29 11:18:25 +02:00
| Name | Type | Description | Required |
|----------|---------------|-------------|----------|
|channel|[Username, chat ID, Update, Message or InputChannel](../types/InputChannel.md) | The supergroup/channel | Optional|
|offset\_id|[int](../types/int.md) | Message ID offset | Yes|
|add\_offset|[int](../types/int.md) | Additional offset | Yes|
|limit|[int](../types/int.md) | Number of results to return | Yes|
|max\_id|[int](../types/int.md) | Maximum message ID | Yes|
|min\_id|[int](../types/int.md) | Minumum message ID | Yes|
2018-04-01 13:24:46 +02:00
### Return type: [messages\_Messages](../types/messages_Messages.md)
### Can bots use this method: **YES**
### MadelineProto Example:
```
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
$messages_Messages = $MadelineProto->channels->getImportantHistory(['channel' => InputChannel, 'offset_id' => int, 'add_offset' => int, 'limit' => int, 'max_id' => int, 'min_id' => int, ]);
```
### [PWRTelegram HTTP API](https://pwrtelegram.xyz) example (NOT FOR MadelineProto):
### As a bot:
POST/GET to `https://api.pwrtelegram.xyz/botTOKEN/madeline`
Parameters:
* method - channels.getImportantHistory
* params - `{"channel": InputChannel, "offset_id": int, "add_offset": int, "limit": int, "max_id": int, "min_id": int, }`
### As a user:
POST/GET to `https://api.pwrtelegram.xyz/userTOKEN/channels.getImportantHistory`
Parameters:
channel - Json encoded InputChannel
offset_id - Json encoded int
add_offset - Json encoded int
limit - Json encoded int
max_id - Json encoded int
min_id - Json encoded int
Or, if you're into Lua:
```
messages_Messages = channels.getImportantHistory({channel=InputChannel, offset_id=int, add_offset=int, limit=int, max_id=int, min_id=int, })
```