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
| Name | Type | Required | Description |
|---|---|---|---|
TitleMissing | bool | — | TitleMissing field of MessagesCreateForumTopicRequest. |
Peer | InputPeerClass | yes | The supergroup, private chat (for forum-enabled bots) or forum bot (for users) where to create the topic. |
Title | string | yes | Topic title (maximum UTF-8 length: 128) |
IconColor | int | — | 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. |
IconEmojiID | int64 | — | 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. |
RandomID | int64 | yes | Unique client message ID to prevent duplicate sending of the same event |
SendAs | InputPeerClass | — | Create the topic as the specified peer |
Returns
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. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.createForumTopic#2f98c3d5