Layer 227
MessagesCreateForumTopic
Create a forum topic.
method
Users
Bots
messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;
Parameters
| Name | Type | Description |
|---|---|---|
| TitleMissing | flags .4? true | If set, the topic has no user-defined title, can only be set for the per-user topics of bot forums; if this field is set, the topic title likely needs to be changed by the bot. |
| Peer | InputPeer | The supergroup, private chat (for forum-enabled bots) or forum bot (for users) where to create the topic. |
| Title | string | Topic title (maximum UTF-8 length: 128) |
| IconColor | flags .0? int | If no custom emoji icon is specified, specifies the color of the fallback topic icon (RGB), one of 0 x 6 FB 9 F 0, 0 x FFD 67 E, 0 x CB 86 DB, 0 x 8 EEE 98, 0 x FF 93 B 2, or 0 x FB 6 F 5 F. |
| IconEmojiId | flags .3? long | ID of the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the input Sticker Set Emoji Default Topic Icons emoji pack. |
| RandomId | long | Unique client message ID to prevent duplicate sending of the same event |
| SendAs | flags .2? InputPeer | Create the topic as the specified peer |
Returns
UpdatesGogram Example
// MessagesCreateForumTopic - using Params struct result, err := client.MessagesCreateForumTopic(&tg.MessagesCreateForumTopicParams{ TitleMissing: nil, Peer: &tg.InputPeerUser{UserID: int64(777000)}, Title: "Hello, World!", IconColor: nil, IconEmojiId: nil, RandomId: int64(1234567890), SendAs: nil, }) if err != nil { // handle error } // result is *tg.Updates
Possible Errors
| Code | Type | Description |
|---|---|---|
| 403 | BOT_FORUM_CREATE_FORBIDDEN | Since the bot's user. bot_forum_can_manage_topics flag is not set, the user cannot create or modify bot forum topics. |
| 400 | CHANNEL_FORUM_MISSING | This supergroup is not a forum. |
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |