Dólar Diario: Scheduled Rates With Trend Memory
Venezuelan exchange rates posted to Discord four times a weekday, scraped from three markets in a single request. Each post remembers the previous one, so readers see the delta and direction rather than a number without context.
- 4 posts/weekday · America/Caracas
- Directional deltas against last run
- 3 markets parsed per fetch
- TypeScript
- Bun
- discord.js
- croner
- node-canvas
The problem
A rate posted on its own is close to useless: readers cannot tell whether 36,40 is a jump, a dip or another quiet day. Checking three sources by hand, four times a day, is also nobody’s job.
The approach
A cron schedule (croner, pinned to America/Caracas, weekdays only) drives the whole bot. One
fetch parses BCV, Promedio and Binance P2P together, so the three numbers in a post always describe
the same moment rather than three separate scrapes.
Trend memory is deliberately boring: the last run’s rates are persisted to a JSON file on disk, and the next post compares against them to render an arrow and a delta. No database, because the state is four numbers. The embed’s colour is keyed to the size of the move, so the magnitude reads before the text does, and the figures are drawn over a random anime backdrop with node-canvas to keep a repeating daily post from looking identical every time.
The outcome
Hands-off updates on a fixed schedule, each carrying its own context. Admins point it at a channel
with /set-channel and verify the full pipeline with /test rather than waiting for 08:00.