1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-13 23:36:04 +02:00
Files
OpenIntegrations/docs/en/md/Telegram/Forum-topic-management/Create-forum-thread.mdx
Vitaly the Alpaca (bot) 6196c8661a Main build (Jenkins)
2025-07-15 23:11:07 +03:00

81 lines
2.2 KiB
Plaintext
Vendored

---
sidebar_position: 2
description: Create forum thread 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
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Telegram]
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Create forum thread
Creates a new thread in the group with theme functionality enabled
`Function CreateForumThread(Val Token, Val ChatID, Val Title, Val IconID = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| ChatID | --forum | String, Number | ✔ | Thread creation chat ID |
| Title | --title | String | ✔ | Thread title |
| IconID | --icon | String | ✖ | See GetAvatarIconList |
Returns: Map Of KeyAndValue - serialized JSON response from Telegram
<br/>
:::tip
Method at API documentation: [createForumTopic](https://core.telegram.org/bots/api#createforumtopic)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "6129457865:AAFyzNYOAFbu...";
Chat = "-1001971186208";
Icon = "5357419403325481346";
Name = "TestTopic " + String(New UUID);
Result = OPI_Telegram.CreateForumThread(Token, Chat, Name, Icon);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint telegram CreateForumThread \
--token "***" \
--forum "-1001971186208" \
--icon "5357419403325481346" \
--title "TestTopic 27b2a34e-73d1-4921-946a-aca7c24d27a9"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint telegram CreateForumThread ^
--token "***" ^
--forum "-1001971186208" ^
--icon "5357419403325481346" ^
--title "TestTopic 27b2a34e-73d1-4921-946a-aca7c24d27a9"
```
</TabItem>
</Tabs>
```json title="Result"
{
"ok": true,
"result": {
"message_thread_id": 5407,
"name": "TestTopic 6e8a9d01-e4f4-4c9e-80fc-004f9bd0d697",
"icon_color": 7322096,
"icon_custom_emoji_id": "5357419403325481346"
}
}
```