MadelineProto/docs/API_docs/methods/channels_readMessageContents.md

70 lines
1.5 KiB
Markdown
Raw Normal View History

---
title: channels.readMessageContents
2018-03-23 16:23:49 +01:00
description: Mark channel/supergroup messages as read
---
## Method: channels.readMessageContents
[Back to methods index](index.md)
2018-03-23 16:23:49 +01:00
Mark channel/supergroup messages as read
### Parameters:
2018-03-23 16:23:49 +01:00
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|
|channel|[Username, chat ID, Update, Message or InputChannel](../types/InputChannel.md) | Optional|The channel|
2018-03-27 14:41:50 +02:00
|id|Array of [int](../types/int.md) | Yes|List of message IDs|
### Return type: [Bool](../types/Bool.md)
2017-10-09 14:10:24 +02:00
### Can bots use this method: **NO**
2017-08-28 12:44:50 +02:00
2018-03-20 19:57:36 +01:00
### 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();
$Bool = $MadelineProto->channels->readMessageContents(['channel' => InputChannel, 'id' => [int, int], ]);
```
2018-03-20 19:57:36 +01:00
### [PWRTelegram HTTP API](https://pwrtelegram.xyz) example (NOT FOR MadelineProto):
### As a user:
POST/GET to `https://api.pwrtelegram.xyz/userTOKEN/channels.readMessageContents`
Parameters:
channel - Json encoded InputChannel
id - Json encoded array of int
Or, if you're into Lua:
```
Bool = channels.readMessageContents({channel=InputChannel, id={int}, })
```
2018-03-27 14:41:50 +02:00
### Errors this method can return:
| Error | Description |
|----------|---------------|
|CHANNEL_INVALID|The provided channel is invalid|
|CHANNEL_PRIVATE|You haven't joined this channel/supergroup|