refactor: make telegram config optional for non-telegram setups
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+7
-3
@@ -154,9 +154,13 @@ export function registerTuiCommand(program: Command): void {
|
||||
currentLocalProvider: config.models.local?.provider,
|
||||
onTransfer: (target) => {
|
||||
if (target === 'telegram') {
|
||||
const telegramUserId = String(config.telegram.allowed_chat_ids[0]);
|
||||
sessionManager.transferSession('tui', 'local', 'telegram', telegramUserId);
|
||||
console.log(`Session transferred to Telegram (${telegramUserId})\n`);
|
||||
if (config.telegram && config.telegram.allowed_chat_ids.length > 0) {
|
||||
const telegramUserId = String(config.telegram.allowed_chat_ids[0]);
|
||||
sessionManager.transferSession('tui', 'local', 'telegram', telegramUserId);
|
||||
console.log(`Session transferred to Telegram (${telegramUserId})\n`);
|
||||
} else {
|
||||
console.log('Telegram not configured\n');
|
||||
}
|
||||
} else {
|
||||
console.log(`Unknown transfer target: ${target}\n`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user