From 8cdafcae4add81ac85d16571994ac5718f5817b8 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 16:38:33 -0800 Subject: [PATCH] Send status report directly via Telegram for proper markdown rendering Previously status.mjs relied on OpenClaw relaying stdout, which sent as plain text. Now sends via sendTelegram() directly when Telegram config is present, matching how all other scripts send notifications. Co-Authored-By: Claude Opus 4.6 --- status.mjs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/status.mjs b/status.mjs index adfcd36..c19b10d 100644 --- a/status.mjs +++ b/status.mjs @@ -3,6 +3,7 @@ * status.mjs — claw-apply status report * Outputs structured JSON for agent formatting * Run: node status.mjs [--json] + * Sends formatted status to Telegram if configured, and prints to stdout. */ import { readFileSync, existsSync } from 'fs'; import { dirname, resolve } from 'path'; @@ -259,17 +260,16 @@ function formatReport(s) { import { loadConfig } from './lib/queue.mjs'; import { sendTelegram } from './lib/notify.mjs'; -const telegramMode = process.argv.includes('--telegram'); const status = buildStatus(); if (jsonMode) { console.log(JSON.stringify(status, null, 2)); -} else if (telegramMode) { +} else { const report = formatReport(status); const settings = loadConfig(resolve(__dir, 'config/settings.json')); - await sendTelegram(settings, report); - console.log('Status sent to Telegram'); -} else { - // Console output keeps markdown * for agents that relay stdout to Telegram - console.log(formatReport(status)); + // Always send via Telegram directly if configured (so markdown renders) + if (settings.notifications?.bot_token && settings.notifications?.telegram_user_id) { + await sendTelegram(settings, report); + } + console.log(report); }