Skip to main content

messages.createForumTopic

Create a forum topic.

func (c *Client) MessagesCreateForumTopic(ctx context.Context, request *MessagesCreateForumTopicRequest) (UpdatesClass, error)

Calling this method​

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesCreateForumTopic(ctx, &tg.MessagesCreateForumTopicRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters​

NameTypeRequiredDescription
TitleMissingbool—TitleMissing field of MessagesCreateForumTopicRequest.
PeerInputPeerClassyesThe supergroup, private chat (for forum-enabled bots) or forum bot (for users) where to create the topic.
TitlestringyesTopic title (maximum UTF-8 length: 128)
IconColorint—If no custom emoji icon is specified, specifies the color of the fallback topic icon (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F.
IconEmojiIDint64—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 inputStickerSetEmojiDefaultTopicIcons emoji pack.
RandomIDint64yesUnique client message ID to prevent duplicate sending of the same event
SendAsInputPeerClass—Create the topic as the specified peer

Returns​

UpdatesClass

Possible errors​

CodeTypeDescription
400CHANNEL_FORUM_MISSINGThis supergroup is not a forum.
400CHANNEL_INVALIDThe provided channel is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.

References​