diff options
| author | Kenneth Lien <kenneth@anthropic.com> | 2026-03-20 13:13:07 -0700 |
|---|---|---|
| committer | Kenneth Lien <kenneth@anthropic.com> | 2026-03-20 13:13:07 -0700 |
| commit | 24a170a704fc2133e20e4464fb44845cb01aa5a8 (patch) | |
| tree | 5c3721e1f3c11bd3a4890b12e55ce79f78abbc91 /external_plugins/telegram | |
| parent | f3fc62a8e73501d30e294eed954caa0cc7dc4289 (diff) | |
| parent | 14927ff475758115791aceb4b53c0aadce8db4d8 (diff) | |
Merge remote-tracking branch 'origin/kenneth/channels-state-dir' into kenneth/channels-rollup
Diffstat (limited to 'external_plugins/telegram')
| -rw-r--r-- | external_plugins/telegram/README.md | 4 | ||||
| -rw-r--r-- | external_plugins/telegram/server.ts | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/external_plugins/telegram/README.md b/external_plugins/telegram/README.md index 8d5632e3..d72dbc1a 100644 --- a/external_plugins/telegram/README.md +++ b/external_plugins/telegram/README.md @@ -35,7 +35,9 @@ Install the plugin: /telegram:configure 123456789:AAHfiqksKZ8... ``` -Writes `TELEGRAM_BOT_TOKEN=...` to `.claude/channels/telegram/.env` in your project. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence. +Writes `TELEGRAM_BOT_TOKEN=...` to `~/.claude/channels/telegram/.env`. You can also write that file by hand, or set the variable in your shell environment — shell takes precedence. + +> To run multiple bots on one machine (different tokens, separate allowlists), point `TELEGRAM_STATE_DIR` at a different directory per instance. **4. Relaunch with the channel flag.** diff --git a/external_plugins/telegram/server.ts b/external_plugins/telegram/server.ts index 3caaf6e1..ee1050c9 100644 --- a/external_plugins/telegram/server.ts +++ b/external_plugins/telegram/server.ts @@ -22,7 +22,7 @@ import { readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync, statSync, import { homedir } from 'os' import { join, extname, sep } from 'path' -const STATE_DIR = join(homedir(), '.claude', 'channels', 'telegram') +const STATE_DIR = process.env.TELEGRAM_STATE_DIR ?? join(homedir(), '.claude', 'channels', 'telegram') const ACCESS_FILE = join(STATE_DIR, 'access.json') const APPROVED_DIR = join(STATE_DIR, 'approved') const ENV_FILE = join(STATE_DIR, '.env') |
