MadelineProtoDocs/docs/docs/CHAT_INFO.md

50 lines
1.9 KiB
Markdown
Raw Normal View History

2018-04-11 14:17:45 +02:00
---
title: Getting info about chats
description: There are various methods that can be used to fetch info about chats, based on bot API id, tg-cli ID, Peer, User, Chat objects.
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
2018-04-01 13:19:25 +02:00
# Getting info about chats
There are various methods that can be used to fetch info about chats, based on bot API id, tg-cli ID, Peer, User, Chat objects.
2019-06-04 23:39:00 +02:00
* [Full chat info with full list of participants](#get_pwr_chat-now-fully-async)
* [Full chat info](#get_full_info-now-fully-async)
* [Reduced chat info (very fast)](#get_info-now-fully-async)
2018-04-01 13:19:25 +02:00
2019-06-01 18:08:28 +02:00
## get_pwr_chat ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))
2018-04-01 13:19:25 +02:00
```php
2019-06-01 18:08:28 +02:00
$pwr_chat = yield $MadelineProto->get_pwr_chat(-100214891824);
2018-04-01 13:19:25 +02:00
foreach ($pwr_chat['participants'] as $participant) {
\danog\MadelineProto\Logger::log($participant);
}
```
Use `get_pwr_chat` to get full chat info, including the full list of members, see [here for the parameters and the result](https://docs.madelineproto.xyz/get_pwr_chat.html).
* Completeness: full
* Speed: medium
* Caching: medium
2019-06-01 18:08:28 +02:00
## get_full_info ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))
2018-04-01 13:19:25 +02:00
```php
2019-06-01 18:08:28 +02:00
$full_chat = yield $MadelineProto->get_full_info(-10028941842);
2018-04-01 13:19:25 +02:00
```
You can also use `get_full_info` to get full chat info, without the full list of members, see [here for the parameters and the result](https://docs.madelineproto.xyz/get_full_info.html).
* Completeness: medium
* Speed: medium-fast
* Caching: full
2019-06-01 18:08:28 +02:00
## get_info ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))
2018-04-01 13:19:25 +02:00
```php
2019-06-01 18:08:28 +02:00
$chat = yield $MadelineProto->get_info(-10028941842);
2018-04-01 13:19:25 +02:00
```
You can also use `get_info` to get chat info, see [here for the parameters and the result](https://docs.madelineproto.xyz/get_info.html)
* Completeness: small
* Speed: very fast
* Caching: full
2019-06-05 12:04:07 +02:00
<a href="https://docs.madelineproto.xyz/docs/DIALOGS.html">Next section</a>