2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 6
2025-05-05 11:15:20 +03:00
description: Get participant count and other functions to work with Telegram in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
2024-10-15 10:16:04 +03:00
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Get participant count
Gets the total number of chat participants
`Function GetParticipantCount(Val Token, Val ChatID) Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Bot token |
| ChatID | --chat | String, Number | ✔ | Target chat ID |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Telegram
<br/>
:::tip
2024-11-21 13:27:18 +03:00
Method at API documentation: [getChatMemberCount](https://core.telegram.org/bots/api#getchatmembercount)
2024-10-15 10:16:04 +03:00
:::
<br/>
2024-12-16 19:38:57 +03:00
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-06-29 14:35:33 +03:00
Token = "6129457865:AAFyzNYOAFbu...";
ChannelID = "@testsichee";
2024-10-15 10:16:04 +03:00
Result = OPI_Telegram.GetParticipantCount(Token, ChannelID);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint telegram GetParticipantCount \
2024-10-22 08:59:24 +03:00
--token "***" \
--chat "@testsichee"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint telegram GetParticipantCount ^
2024-10-22 08:59:24 +03:00
--token "***" ^
--chat "@testsichee"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"ok": true,
"result": 2
}
```