How ultsi/blakkisvuohi works
BläkkisVuohi is a Telegram bot for recording drinks and estimating current blood-alcohol concentration (EBAC). Users add drinks through commands or the guided /start flow; the bot calculates and reports estimates. Group commands extend this with member and drink summaries, while separate commands provide personal history, charts and statistics. The graph follows the documented capabilities and indexed module references; several command implementations and runtime wiring were not sampled, so uncertain links are omitted.
Main entry points: users.js User profiles · groups.js Group summaries · commands.js Command dispatch · init.js Message hooks
Components 22
Bot and commands
- Bot entry
index.js - Message hooks
app/init.js - Command dispatch
app/lib/commands.js
Drinks and EBAC
- Guided drinking
app/commands/start/juo.js - Add drink
app/commands/juoma.js - Backdated drinks
app/commands/jalkikellotus.js - Drink shortcuts
app/commands/kalja033.js - Alcohol calculations
app/lib/alcomath.js
Users and groups
- User profiles
app/db/users.js - Profile commands
app/commands/tunnus.js - Setup settings
app/commands/start/asetukset.js - Group summaries
app/db/groups.js - Group commands
app/commands/promillet.js
History and statistics
- Drink history
app/commands/annokset.js - Group chart
app/commands/kuvaaja.js - Chart rendering
app/lib/linechart.js - Usage statistics
app/db/stats.js - Statistics commands
app/commands/stats.js
Shared runtime
- Message helpers
app/lib/message.js - Bot settings
app/settings.js
Other components
- Telegram user
- PostgreSQL
Connections 26
- Telegram user → Message hooks: sends updates
app/init.js - Bot entry → Message hooks: initializes
index.js - Message hooks → Command dispatch: forwards updates
app/init.js - Message hooks → Add drink: loads commands
app/init.js - Command dispatch → User profiles: loads user
app/lib/commands.js - Command dispatch → Bot settings: reads settings
app/lib/commands.js - Command dispatch → Guided drinking: dispatches flow
- Guided drinking → User profiles: records drinks
app/commands/start/juo.js - Guided drinking → Alcohol calculations: calculates EBAC
app/commands/start/juo.js - Add drink → Alcohol calculations: checks alcohol
app/commands/juoma.js - Add drink → Message helpers: builds replies
app/commands/juoma.js - Backdated drinks → Alcohol calculations: checks alcohol
app/commands/jalkikellotus.js - Drink shortcuts → User profiles: records drinks
app/commands/kalja033.js - Profile commands → User profiles: updates profile
app/commands/tunnus.js - Setup settings → User profiles: updates settings
app/commands/start/asetukset.js - Group commands → Group summaries: fetches summaries
app/commands/promillet.js - Group summaries → User profiles: builds member data
app/db/groups.js - Group summaries → Alcohol calculations: calculates EBAC
app/db/groups.js - Drink history → Group summaries: fetches drink data
app/commands/annokset.js - Group chart → Group summaries: fetches drink data
app/commands/kuvaaja.js - Group chart → Chart rendering: renders chart
app/commands/kuvaaja.js - Group chart → User profiles: loads users
app/commands/kuvaaja.js - Statistics commands → Usage statistics: fetches statistics
app/commands/stats.js - User profiles → PostgreSQL: queries
app/db/users.js - Group summaries → PostgreSQL: queries
app/db/groups.js - Usage statistics → PostgreSQL: queries
app/db/stats.js