Candlestick charts
Turn it on with "kline": { "enabled": true }; no browser and no API key are needed. send_reply then gains a kline_image part with symbol (such as BTCUSDT; BTC/USDT is accepted too), interval (15m, 1h, 4h, 1d, 1w) and an optional limit (number of candles, 10–120, default 60).
- Data: the bot fetches candles from Binance's public market-data mirror
data-api.binance.vision, not through the model, so prices cannot be invented. Only Binance spot pairs work; for an unknown pair or a network failure the wholesend_replysends nothing, the character explains in text, and the log recordsreply_part_failed(part_type: kline_image) with an error category. - Rendering: The SVG is written directly by code (candles, volume bars, axes) and
@resvg/resvg-jsturns it into a 1600×1000 PNG: candlesticks over volume bars, red for up and green for down, times in UTC. Text uses system fonts; on Debian/Ubuntu make sure DejaVu Sans (fonts-dejavu-core, usually preinstalled) is present. Startup does one trial render of two synthetic candles; if it fails the bot only logskline_unavailableand the feature stays off.kline_enabled: truein the startupreadylog means it is active. - Stored content: the message caption is generated from the data, for example
📈 BTCUSDT 日线 · 最新 67123.45 · 近 60 根 +5.20%; that is what later turns see for this message. A character that wants to comment adds atextpart after the chart.
