diff options
| author | Kenneth Lien <kenneth@anthropic.com> | 2026-03-20 10:56:57 -0700 |
|---|---|---|
| committer | Kenneth Lien <kenneth@anthropic.com> | 2026-03-20 10:56:57 -0700 |
| commit | 14927ff475758115791aceb4b53c0aadce8db4d8 (patch) | |
| tree | 7e22acd57b7b086463a2693f8422f824a66b293d /external_plugins/telegram/server.ts | |
| parent | 90accf6fd2008fe0ee9578ebc088740c3a754d58 (diff) | |
telegram/discord: make state dir configurable via env varkenneth/channels-state-dir
Hardcoded ~/.claude/channels/<name>/ meant only one bot per machine.
Respect TELEGRAM_STATE_DIR / DISCORD_STATE_DIR so users can run
multiple bots with separate tokens and allowlists.
Also fixed README path ('in your project' -> '~/...') to match the code.
Fixes #792
Diffstat (limited to 'external_plugins/telegram/server.ts')
| -rw-r--r-- | external_plugins/telegram/server.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/external_plugins/telegram/server.ts b/external_plugins/telegram/server.ts index 8acd52a2..98271d0d 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') |
