Setup: a bot with direct-messages topics enabled (Bot API 9.3, has_topics_enabled), iOS client, the "New Chat" tab of the bot chat.
Steps to reproduce:
- Open the bot's New Chat tab.
- Tap a slash command from the suggestion list / command menu (do not type it manually).
Expected: same behavior as a typed message — the client creates the topic and switches the user into it before sending.
Actual: the user stays in the New Chat tab. The topic is created server-side (the bot receives forum_topic_created with the command as the implicit name and a message_thread_id), but the client does not enter it. The client-synthesized "Continue Last Thread" button under the sent command opens that topic empty until the bot's reply lands there, which reads as a broken button.
Where the paths diverge in the code:
- A typed message from the root of a user-managed bot forum goes through the new-topic redirect in
submodules/TelegramUI/Sources/ChatControllerNode.swift: targetThreadId = EngineMessage.newTopicThreadId + updateChatLocationThread(...) before sending — so the UI switches into the topic.
- A tapped command goes through the
sendBotCommand interaction in submodules/TelegramUI/Sources/ChatController.swift, which sends with threadId: chatLocation.threadId (nil at the root) and contains none of the new-topic/navigation logic.
- "Continue Last Thread" (
ChatHistoryEntriesForView.swift → ChatMessageBubbleItemNode.swift) decorates the last message with a threadId and its tap handler only opens that thread locally, so it lands on an empty view.
Suggestion: route tapped bot commands in a topics-enabled bot chat through the same new-topic path as typed messages (redirect into newTopicThreadId and switch the chat location), so the user follows the command into its topic.
Nothing on the Bot API side can compensate: there is no method to navigate the client or pre-render the topic; a bot can only reply into the received message_thread_id as fast as possible.
Setup: a bot with direct-messages topics enabled (Bot API 9.3,
has_topics_enabled), iOS client, the "New Chat" tab of the bot chat.Steps to reproduce:
Expected: same behavior as a typed message — the client creates the topic and switches the user into it before sending.
Actual: the user stays in the New Chat tab. The topic is created server-side (the bot receives
forum_topic_createdwith the command as the implicit name and amessage_thread_id), but the client does not enter it. The client-synthesized "Continue Last Thread" button under the sent command opens that topic empty until the bot's reply lands there, which reads as a broken button.Where the paths diverge in the code:
submodules/TelegramUI/Sources/ChatControllerNode.swift:targetThreadId = EngineMessage.newTopicThreadId+updateChatLocationThread(...)before sending — so the UI switches into the topic.sendBotCommandinteraction insubmodules/TelegramUI/Sources/ChatController.swift, which sends withthreadId: chatLocation.threadId(nil at the root) and contains none of the new-topic/navigation logic.ChatHistoryEntriesForView.swift→ChatMessageBubbleItemNode.swift) decorates the last message with athreadIdand its tap handler only opens that thread locally, so it lands on an empty view.Suggestion: route tapped bot commands in a topics-enabled bot chat through the same new-topic path as typed messages (redirect into
newTopicThreadIdand switch the chat location), so the user follows the command into its topic.Nothing on the Bot API side can compensate: there is no method to navigate the client or pre-render the topic; a bot can only reply into the received
message_thread_idas fast as possible.