Bot forums: read updateMessageID before processUpdates when creating a topic
Ric committed
- Author
- Ric · 61457974+dallo28@users.noreply.github.comOct 19, 2026 at 11:06
- Committer
- dallo28 · dallo28@users.noreply.github.comOct 19, 2026 at 13:07
- Parents
- f32ffeec763f
Bot forums: read updateMessageID before processUpdates when creating a topic Since 13.0.0, MessagesController.processUpdates() removes TL_updateMessageID entries from updates.updates before handling them. BotForumHelper called processUpdates() on the messages.createForumTopic result first and only then looked for TL_updateMessageID, so it never found it and completed with topicId = -1. The message typed or forwarded into "New Thread" was then sent with reply_to_msg_id / top_msg_id = -1 and landed outside the newly created topic, which stayed empty, and the bot received it with no message_thread_id. Look up TL_updateMessageID before calling processUpdates(), as TopicCreateFragment already does for group forums, and match it on the request's random_id. If no TL_updateMessageID matches, fall back to the topic-create service message for this bot in the same response. When topic creation fails, send the message as is instead of binding it (and its local copy) to topic -1. The guard is the same one proposed in DrKLO/Telegram#2179. The resent request is remembered so the interceptor lets it through; otherwise it would try to create a topic again on every resend, in an endless loop. Fixes https://bugs.telegram.org/c/66439 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed+33−11