aiogram/docs/api/methods/get_chat_members_count.md

55 lines
1 KiB
Markdown
Raw Normal View History

# getChatMembersCount
## Description
Use this method to get the number of members in a chat. Returns Int on success.
## Arguments
| Name | Type | Description |
| - | - | - |
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
## Response
Type: `#!python3 int`
Description: Returns Int on success.
## Usage
### As bot method bot
```python3
result: int = await bot.get_chat_members_count(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetChatMembersCount`
- `from aiogram.api.methods import GetChatMembersCount`
- `from aiogram.api.methods.get_chat_members_count import GetChatMembersCount`
2020-01-11 22:59:14 +02:00
#### In handlers with current bot
```python3
2020-01-11 22:59:14 +02:00
result: int = await GetChatMembersCount(...)
```
2020-01-11 22:59:14 +02:00
#### With specific bot
```python3
2020-01-11 22:59:14 +02:00
result: int = await bot(GetChatMembersCount(...))
```
2020-01-11 22:59:14 +02:00
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getchatmemberscount)