Skip to content

Commit

Permalink
topic: rename IconCustomEmojiID to IconCustomEmoji
Browse files Browse the repository at this point in the history
  • Loading branch information
demget committed Mar 4, 2024
1 parent e4f891b commit 0d0d5e7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
)

type Topic struct {
Name string `json:"name"`
IconColor int `json:"icon_color"`
IconCustomEmojiID string `json:"icon_custom_emoji_id"`
ThreadID int `json:"message_thread_id"`
Name string `json:"name"`
IconColor int `json:"icon_color"`
IconCustomEmoji string `json:"icon_custom_emoji_id"`
ThreadID int `json:"message_thread_id"`
}

// CreateTopic creates a topic in a forum supergroup chat.
Expand All @@ -22,8 +22,8 @@ func (b *Bot) CreateTopic(chat *Chat, topic *Topic) (*Topic, error) {
if topic.IconColor != 0 {
params["icon_color"] = strconv.Itoa(topic.IconColor)
}
if topic.IconCustomEmojiID != "" {
params["icon_custom_emoji_id"] = topic.IconCustomEmojiID
if topic.IconCustomEmoji != "" {
params["icon_custom_emoji_id"] = topic.IconCustomEmoji
}

data, err := b.Raw("createForumTopic", params)
Expand All @@ -50,8 +50,8 @@ func (b *Bot) EditTopic(chat *Chat, topic *Topic) error {
if topic.Name != "" {
params["name"] = topic.Name
}
if topic.IconCustomEmojiID != "" {
params["icon_custom_emoji_id"] = topic.IconCustomEmojiID
if topic.IconCustomEmoji != "" {
params["icon_custom_emoji_id"] = topic.IconCustomEmoji
}

_, err := b.Raw("editForumTopic", params)
Expand Down

0 comments on commit 0d0d5e7

Please sign in to comment.