2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 2
|
|
|
|
---
|
|
|
|
|
|
|
|
# Create forum thread
|
|
|
|
Creates a new thread in the group with theme functionality enabled
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
`Function CreateForumThread(Val Token, Val ChatID, Val Title, Val IconID = "") Export`
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
| ChatID | --forum | String, Number | Thread creation chat ID |
|
|
|
|
| Title | --title | String | Thread title |
|
|
|
|
| IconID | --icon | String | See GetAvatarIconList |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - Serialized JSON response from Telegram
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 13:05:58 +02:00
|
|
|
<br/>
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-07-10 12:58:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
2024-07-10 13:24:11 +02:00
|
|
|
Token = "6129457865:AAFyzNYOAFbu...";
|
2024-06-05 12:19:46 +02:00
|
|
|
Chat = "-1001971186208";
|
|
|
|
Icon = "5357419403325481346";
|
|
|
|
Name = "TestTopic " + String(New UUID);
|
|
|
|
|
|
|
|
Result = OPI_Telegram.CreateForumThread(Token, Chat, Name, Icon);
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
|
|
|
|
|
|
|
oint telegram CreateForumThread --token "6129457865:AAFyzNYOAFbu..." --forum %forum% --title %title% --icon %icon%
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-07-10 13:11:17 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"ok": true,
|
|
|
|
"result": {
|
|
|
|
"message_thread_id": 2457,
|
|
|
|
"name": "TestTopic bb6937b8-0372-4118-81f5-cb75b85c4627",
|
|
|
|
"icon_color": 7322096,
|
|
|
|
"icon_custom_emoji_id": "5357419403325481346"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|