diff --git a/gateway/platforms/telegram.py b/gateway/platforms/telegram.py index e849a03c77..01bcf4da9a 100644 --- a/gateway/platforms/telegram.py +++ b/gateway/platforms/telegram.py @@ -496,6 +496,13 @@ class TelegramAdapter(BasePlatformAdapter): "[%s] DM topic '%s' already exists in chat %s (will be mapped from incoming messages)", self.name, name, chat_id, ) + elif "not a forum" in error_text or "forums_disabled" in error_text: + logger.warning( + "[%s] Cannot create DM topic '%s' in chat %s: Topics mode is not enabled. " + "The user must open the DM with this bot in Telegram, tap the bot name " + "at the top, and enable 'Topics' in chat settings before topics can be created.", + self.name, name, chat_id, + ) else: logger.warning( "[%s] Failed to create DM topic '%s' in chat %s: %s", diff --git a/website/docs/user-guide/messaging/telegram.md b/website/docs/user-guide/messaging/telegram.md index a92fc8d223..dbdfc3f4ac 100644 --- a/website/docs/user-guide/messaging/telegram.md +++ b/website/docs/user-guide/messaging/telegram.md @@ -325,6 +325,16 @@ Each topic gets its own conversation session, history, and context — completel ### Configuration +:::caution Prerequisites +Before adding topics to your config, the user must **enable Topics mode** in the DM chat with the bot: + +1. Open your private chat with the Hermes bot in Telegram +2. Tap the bot's name at the top to open chat info +3. Enable **Topics** (the toggle to turn the chat into a forum) + +Without this, Hermes will log `The chat is not a forum` on startup and skip topic creation. This is a Telegram client-side setting — the bot cannot enable it programmatically. +::: + Add topics under `platforms.telegram.extra.dm_topics` in `~/.hermes/config.yaml`: ```yaml