Skip to content

Commit 056adad

Browse files
author
John O'Hare
committed
docs: Improve setup guide based on user onboarding feedback
- Clarify BotFather is a real bot to message directly, not a settings page - Add step-by-step for adding bot during group creation - Document Telegram Web limitation: cannot enable Topics (use desktop/mobile) - Add easiest method for getting chat ID via curl + getUpdates - Add config file setup option (recommended) alongside env vars - Add tips for empty getUpdates results and bot member search Co-Authored-By: DreamLabAI <github@thedreamlab.uk>
1 parent 68afc23 commit 056adad

1 file changed

Lines changed: 62 additions & 11 deletions

File tree

docs/SETUP.md

Lines changed: 62 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ sequenceDiagram
6262
Note over You,BotFather: Privacy mode must be OFF<br/>for the bot to see all messages
6363
```
6464

65-
1. Open Telegram and message [@BotFather](https://t.me/botfather)
66-
2. Send `/newbot` and follow the prompts
67-
3. Copy the **bot token** (format: `123456789:ABCdefGHIjklMNOpqrsTUVwxyz`)
68-
4. **Disable privacy mode**: `/mybots` -> Select bot -> Bot Settings -> Group Privacy -> **Turn off**
65+
1. Open Telegram (desktop app or mobile — **not** a self-chat)
66+
2. Use the **search bar** to find `BotFather` — select the one with the **blue verified checkmark**
67+
3. Start a direct chat with @BotFather and send `/newbot`
68+
4. BotFather will ask for a **display name** (e.g. "Claude Mirror") and a **username** (must end in `bot`, e.g. `claude_mirror_bot`)
69+
5. Copy the **bot token** it gives you (format: `123456789:ABCdefGHIjklMNOpqrsTUVwxyz`)
70+
6. **Disable privacy mode**: `/mybots` -> Select bot -> Bot Settings -> Group Privacy -> **Turn off**
71+
72+
> **Note:** @BotFather is a real Telegram bot you message directly — it is not a settings page or a chat with yourself.
6973
7074
## Step 3: Create a Supergroup with Topics
7175

@@ -83,30 +87,75 @@ graph TB
8387
```
8488

8589
1. Create a new group in Telegram
86-
2. Add your bot to the group
87-
3. Go to Group Settings -> Enable **Topics**
90+
2. **Add your bot during group creation**: in the "Add Members" screen, search for your bot's username (e.g. `TheDreamLabBot`) and select it
91+
3. Go to Group Settings -> Enable **Topics** to convert it to a forum supergroup
8892
4. Make the bot an **Administrator** with these permissions:
8993
- Manage Topics
9094
- Post Messages
9195
- Delete Messages (optional, for topic cleanup)
9296

97+
> **Telegram Web limitation:** Enabling Topics (converting a group to a forum) may not be available in Telegram Web. Use the **Telegram desktop app** or **mobile app** to enable Topics in group settings. Once enabled, the forum works fine in Telegram Web.
98+
>
99+
> **Adding the bot:** If the group already exists, open the group -> click the group name header -> **Add Members** -> search for your bot username.
100+
93101
## Step 4: Get Your Chat ID
94102

95103
The chat ID identifies your supergroup. Supergroup IDs start with `-100`.
96104

105+
### Easiest method
106+
107+
1. Send any message in the group where your bot is a member
108+
2. Run this command (replace `YOUR_TOKEN` with your bot token):
109+
110+
```bash
111+
curl -s "https://api.telegram.org/botYOUR_TOKEN/getUpdates" | python3 -m json.tool
112+
```
113+
114+
3. Look for `"chat": {"id": -100XXXXXXXXXX}` in the response — that negative number is your chat ID
115+
97116
### Using the helper script
98117

99118
```bash
100119
./scripts/get-chat-id.sh YOUR_BOT_TOKEN
101120
```
102121

103-
### Manual method
122+
> **Tip:** If `getUpdates` returns an empty result, make sure you've sent a message in the group **after** adding the bot. The bot only sees messages sent after it joined.
123+
124+
## Step 5: Configure
125+
126+
### Option A: Config file (recommended)
127+
128+
Create `~/.config/claude-telegram-mirror/config.json`:
129+
130+
```bash
131+
mkdir -p ~/.config/claude-telegram-mirror
132+
chmod 700 ~/.config/claude-telegram-mirror
133+
```
134+
135+
```json
136+
{
137+
"bot_token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz",
138+
"chat_id": -1001234567890,
139+
"enabled": true,
140+
"approvals": true,
141+
"use_threads": true,
142+
"rate_limit": 20,
143+
"session_timeout": 1800,
144+
"auto_delete_topics": false
145+
}
146+
```
104147

105-
1. Send any message in the group
106-
2. Visit: `https://api.telegram.org/botYOUR_TOKEN/getUpdates`
107-
3. Find `"chat": {"id": -100XXXXXXXXXX}` in the response
148+
```bash
149+
chmod 600 ~/.config/claude-telegram-mirror/config.json
150+
```
151+
152+
Or use the interactive wizard which validates your token and chat ID:
153+
154+
```bash
155+
ctm setup
156+
```
108157

109-
## Step 5: Configure Environment
158+
### Option B: Environment variables
110159

111160
Create `~/.telegram-env`:
112161

@@ -122,6 +171,8 @@ Source it in your shell profile (`~/.bashrc` or `~/.zshrc`):
122171
[[ -f ~/.telegram-env ]] && source ~/.telegram-env
123172
```
124173

174+
> **Note:** Environment variables take precedence over the config file. You can mix both — use the config file for stable settings and env vars for overrides.
175+
125176
### All Configuration Options
126177

127178
```mermaid

0 commit comments

Comments
 (0)