Layer 224
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
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

Updates

Gogram Example

// MessagesCreateForumTopic - using Params struct
result, err := client.MessagesCreateForumTopic(&tg.MessagesCreateForumTopicParams{
    Peer: &tg.InputPeerUser{UserID: int64(777000)},
    Title: "Hello, World!",
    RandomId: int64(1234567890),

    // Optional fields:
    // TitleMissing: true,
    // IconColor: 42,
    // IconEmojiId: int64(1234567890),
    // SendAs: &tg.InputPeerUser{UserID: int64(777000)},
})
if err != nil {
    // handle error
}
// result is *tg.Updates

Possible Errors

Code Type Description
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.