fix: provider startup order and enable flags
This commit is contained in:
@@ -13,25 +13,35 @@ export async function buildProviderSummary(
|
||||
const effective = cfg ?? loadConfig();
|
||||
const lines: string[] = [];
|
||||
|
||||
const webLinked = await webAuthExists();
|
||||
const authAgeMs = getWebAuthAgeMs();
|
||||
const authAge = authAgeMs === null ? "unknown" : formatAge(authAgeMs);
|
||||
const { e164 } = readWebSelfId();
|
||||
lines.push(
|
||||
webLinked
|
||||
? chalk.green(
|
||||
`WhatsApp: linked${e164 ? ` as ${e164}` : ""} (auth ${authAge})`,
|
||||
)
|
||||
: chalk.red("WhatsApp: not linked"),
|
||||
);
|
||||
const webEnabled = effective.web?.enabled !== false;
|
||||
if (!webEnabled) {
|
||||
lines.push(chalk.cyan("WhatsApp: disabled"));
|
||||
} else {
|
||||
const webLinked = await webAuthExists();
|
||||
const authAgeMs = getWebAuthAgeMs();
|
||||
const authAge = authAgeMs === null ? "unknown" : formatAge(authAgeMs);
|
||||
const { e164 } = readWebSelfId();
|
||||
lines.push(
|
||||
webLinked
|
||||
? chalk.green(
|
||||
`WhatsApp: linked${e164 ? ` as ${e164}` : ""} (auth ${authAge})`,
|
||||
)
|
||||
: chalk.red("WhatsApp: not linked"),
|
||||
);
|
||||
}
|
||||
|
||||
const telegramToken =
|
||||
process.env.TELEGRAM_BOT_TOKEN ?? effective.telegram?.botToken;
|
||||
lines.push(
|
||||
telegramToken
|
||||
? chalk.green("Telegram: configured")
|
||||
: chalk.cyan("Telegram: not configured"),
|
||||
);
|
||||
const telegramEnabled = effective.telegram?.enabled !== false;
|
||||
if (!telegramEnabled) {
|
||||
lines.push(chalk.cyan("Telegram: disabled"));
|
||||
} else {
|
||||
const telegramToken =
|
||||
process.env.TELEGRAM_BOT_TOKEN ?? effective.telegram?.botToken;
|
||||
lines.push(
|
||||
telegramToken
|
||||
? chalk.green("Telegram: configured")
|
||||
: chalk.cyan("Telegram: not configured"),
|
||||
);
|
||||
}
|
||||
|
||||
const allowFrom = effective.routing?.allowFrom?.length
|
||||
? effective.routing.allowFrom.map(normalizeE164).filter(Boolean)
|
||||
|
||||
Reference in New Issue
Block a user