mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-17 17:51:20 +08:00
When streaming is enabled, markdownify() can produce empty strings for certain inputs (whitespace-only, formatting-only markdown). The draft sender loop then calls sendMessageDraft with empty text, which Telegram rejects with 'Text must be non-empty', flooding the log every 0.5s. Add an early return in _send_message_draft() when text is empty or whitespace-only. This matches WebChat's approach of skipping empty responses. Fixes #7353 Co-authored-by: Yufeng He <40085740+universeplayer@users.noreply.github.com>