Skip to content

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 whole send_reply sends nothing, the character explains in text, and the log records reply_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-js turns 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 logs kline_unavailable and the feature stays off. kline_enabled: true in the startup ready log 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 a text part after the chart.

BSD 2-Clause License