Skip to content

skill: add /add-telegram-threads-autoregistration#136

Open
farooqu wants to merge 3 commits into
nanocoai:mainfrom
farooqu:feat/telegram-thread-auto-register
Open

skill: add /add-telegram-threads-autoregistration#136
farooqu wants to merge 3 commits into
nanocoai:mainfrom
farooqu:feat/telegram-thread-auto-register

Conversation

@farooqu
Copy link
Copy Markdown

@farooqu farooqu commented Mar 28, 2026

Summary

Adds the add-telegram-threads-autoregistration skill, which lets users opt in to automatically registering Telegram forum threads as isolated groups.

When applied, any new thread message in a registered supergroup is automatically registered as its own group — inheriting the parent's trigger, container config, and requiresTrigger setting — so each forum topic gets its own isolated context without manual registration.

Depends on

Requires the forum thread support from PR #135. The TelegramChannel class must already have the topicNames map and forum_topic_created/forum_topic_edited listeners before this skill is applied.

How it works

This is an instruction-only skill (no code on this branch). When a user runs /add-telegram-threads-autoregistration, Claude follows the SKILL.md to make the changes:

  • Adds registerGroup? callback to ChannelOpts and TelegramChannelOpts
  • Wires the existing registerGroup function from index.ts into channel opts
  • Adds a private autoRegisterThread method to TelegramChannel
  • Adds auto-register checks in both the text and non-text message handlers

🤖 Generated with Claude Code

farooqu and others added 2 commits March 28, 2026 17:10
- Route messages to thread-scoped JIDs (tg:<chatId>:<threadId>) when
  registered, falling back to base chat JID for unregistered threads
- Cache forum topic names from forum_topic_created/edited events so
  registered threads get meaningful names instead of the parent group title
- /chatid in a thread now shows both the thread JID (with topic name if
  cached) and the base chat JID
- /ping, sendMessage, and setTyping are all thread-aware — replies land
  in the correct topic rather than the General channel
- Remove unused parseTelegramJid export
- Add comprehensive tests covering routing, topic caching, commands, and
  thread-aware send/typing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a message arrives in a thread of a registered supergroup, NanoClaw
automatically registers the thread as its own isolated group. The thread
inherits the parent's trigger, containerConfig, and requiresTrigger.

Adds the add-auto-register-telegram-threads skill (SKILL.md) so users
can apply this feature on demand. Code changes are limited to the
Telegram skill — no core types or DB schema touched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the opaque `tg<chatId>-<threadId>` folder pattern with
`<parentFolder>_<threadSlug>`, where threadSlug is the topic name
lowercased and slugified (e.g. `telegram_mygroup_support`).

Co-Authored-By: Claude Sonnet 4.6 <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