Skip to content

Topic icon, label and preview per department of the bot - #103

Open
mysubcult wants to merge 4 commits into
LiveHelperChat:masterfrom
mysubcult:feat/topic-icons
Open

mysubcult wants to merge 4 commits into
LiveHelperChat:masterfrom
mysubcult:feat/topic-icons

Conversation

@mysubcult

@mysubcult mysubcult commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What

Next to every department in Telegram bots > Edit bot departments (operator bots):

  • Topic icon — one of Telegram's free topic icons (getForumTopicIconStickers — bots may use only these, no Telegram Premium needed) → icon_custom_emoji_id; or the default icon in one of the six allowed colours → icon_color; nothing → the default icon, as now.
  • Topic names start with Department · instead of [Department], e.g. Sales · Nick #12 | …, so the first letter is the department's, not [.
  • Topic label — when set, topic names of the department start with <label> · instead, e.g. TG · Nick #12 | …. A coloured default icon shows the first letter of the topic name, so it becomes a blue T.
  • A preview of the icon and the topic name for every department, updated as you change them.

Why: mobile clients draw the first letter of the topic name as its icon, and for chat topics that is always [ ([Department] Nick #id …), so every topic looks the same in the topic list.

How

  • New columns lhc_telegram_bot_dep.topic_icon and topic_label (varchar(50), doc/structure.json / doc/install.sql). The icon value is checked against the icon set and the colour list before saving.
  • providers/TelegramTopicIcons.php: addIcon() wraps the data of the three createForumTopic calls, topicPrefix() builds the start of the topic name in the four places it is built (including editForumTopic on page change). The icon set is cached for a day in cache/telegram_topic_icons_<bot id>.json; on an API error topics are created without an icon.
  • README section.

Without any setting topics get the default icon as now; only the brackets around the department name are gone. #102 (mail topics) uses the same helper when it is present.

🤖 Generated with Claude Code

Every department of an operator bot gets a Topic icon select in Edit bot
departments: one of Telegram's free topic icons (getForumTopicIconStickers,
no Premium needed) or the default icon in one of the six colours. Stored in
lhc_telegram_bot_dep.topic_icon and passed to the three createForumTopic calls
as icon_custom_emoji_id / icon_color. Mobile clients otherwise draw the first
letter of the topic name, which is "[" for every chat topic.
@mysubcult mysubcult changed the title Topic icon from the department name Topic icon per department of the bot Oct 26, 2026
lhc_telegram_bot_dep.topic_label: when set, topic names start with "<label> ·"
instead of "[Department]" (also on page change), so a coloured default icon
shows a meaningful letter instead of "[". Edit bot departments shows a preview
of the icon and the topic name for every department.
@mysubcult mysubcult changed the title Topic icon per department of the bot Topic icon, label and preview per department of the bot Oct 26, 2026
mysubcult and others added 2 commits October 26, 2026 18:44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant