Suppress Telegram messages when no actionable signals found

Auto-scan still runs and updates the level cache every cycle,
but only sends to Telegram when quality A+/A/B/C signals exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
harwinder
2026-05-11 18:03:49 -04:00
parent 4be7077c0a
commit 5e12307b1f
+6 -1
View File
@@ -390,9 +390,14 @@ async def _scan_timeframe(
_update_level_cache(reports) _update_level_cache(reports)
summary = _format_scan_summary(reports, tf)
actionable = [r for r in reports if r.signal_quality in ("A+", "A", "B", "C")] actionable = [r for r in reports if r.signal_quality in ("A+", "A", "B", "C")]
if not actionable:
logger.info(f"{tf.value} scan: no actionable signals — skipping Telegram message")
return
summary = _format_scan_summary(reports, tf)
for chat_id in list(_autoscan_chats): for chat_id in list(_autoscan_chats):
try: try:
await bot.send_message(chat_id, summary, parse_mode=ParseMode.MARKDOWN) await bot.send_message(chat_id, summary, parse_mode=ParseMode.MARKDOWN)