Skip to content
All projects

~/projects/blakkiskili

Bläkkiskili

2026

  • TypeScript
  • Bun
  • grammY
  • SQLite
  • SvelteKit
  • Docker

Bläkkiskili is a Telegram bot (@blakkiskili_bot) that estimates your blood alcohol concentration from the drinks you log. In group chats it shows who is at what level and draws a chart with a 12-hour forecast. The same data is available on a companion website.

It is an independent rewrite of the original BläkkisVuohi bot by Joonas Ulmanen, which shuts down in November 2026. The estimation maths is ported unchanged, and users can import their history from the old bot.

Features

  • Drink logging with presets, custom drinks, late logging and undo
  • Group commands for current levels and drink counts, plus a chart image of everyone's estimate
  • Alko product search using the Alkometriikka catalogue, in Telegram's inline mode or by typing, with nicknames such as jallu and kossu
  • Barcode scanning: send a barcode number or a photo, or use the camera on the website
  • Energy estimates (kcal) and consumption statistics
  • Export and import as CSV, including history from the old bot
  • Website: a SvelteKit single-page app served by the bot's own process, with Telegram sign-in

Privacy

Data minimisation was the reason the original bot was shut down, so it shaped the design:

  • Telegram user and chat IDs are stored only as keyed hashes (HMAC-SHA256), and display names are encrypted with AES-256-GCM.
  • The bot receives only commands in groups, never message contents.
  • Deleting an account removes everything immediately, and inactive accounts are deleted automatically after a warning.

Running it

The bot runs on Bun with a SQLite database, in a hardened Docker container: read-only filesystem, no capabilities, non-root user. Hourly database snapshots are shipped off-site with restic, encrypted on the client. The website is reached only through a Cloudflare Tunnel.

Unit and end-to-end tests run against a fake Telegram API.

The estimates are calculated values, not measurements.