mirror of
https://github.com/anthropics/claude-plugins-official.git
synced 2026-05-21 14:32:40 +00:00
fix(telegram): honor TELEGRAM_STATE_DIR/CLAUDE_CONFIG_DIR in skills and server
The server already reads TELEGRAM_STATE_DIR for multi-bot setups, but the /telegram:access and /telegram:configure skills hardcoded ~/.claude/channels/telegram/ in 11 places. So with a custom state dir the skill writes access.json to the default location while the server reads from the override — pairing and allowlist edits silently don't take effect. Skills now resolve the state dir via shell expansion (TELEGRAM_STATE_DIR → CLAUDE_CONFIG_DIR/channels/telegram → ~/.claude/channels/telegram) before any read/write. Server gets the same CLAUDE_CONFIG_DIR fallback. Also adds Bash(echo)/Bash(chmod) to configure skill's allowed-tools (chmod was already documented but not allowlisted).
This commit is contained in:
@@ -23,7 +23,8 @@ import { readFileSync, writeFileSync, mkdirSync, readdirSync, rmSync, statSync,
|
||||
import { homedir } from 'os'
|
||||
import { join, extname, sep } from 'path'
|
||||
|
||||
const STATE_DIR = process.env.TELEGRAM_STATE_DIR ?? join(homedir(), '.claude', 'channels', 'telegram')
|
||||
const STATE_DIR = process.env.TELEGRAM_STATE_DIR
|
||||
?? join(process.env.CLAUDE_CONFIG_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')
|
||||
|
||||
Reference in New Issue
Block a user