Skip to content

JkLondon/uraka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uraka - Productivity Tracker Bot

Telegram bot for tracking productivity by asking what you did every 15 minutes.

Features

  • Sends reminders every 15 minutes starting at 9:00 AM (Madrid time)
  • Saves your responses to SQLite database
  • Stops tracking when you send stop word (case insensitive):
    • Russian: "ложусь спать"
    • English: "going to sleep", "going to bed", "good night"
  • Generates daily reports with all activities
  • Multi-language support: Russian and English
  • Long report support: Automatically uses Telegraph for long reports, falls back to MD file
  • Demo mode for testing

Setup

  1. Get a Telegram bot token from @BotFather

  2. Copy .env.example to .env and fill in your values:

cp .env.example .env

Edit .env file:

TELEGRAM_BOT_TOKEN=your_bot_token_here
DATABASE_PATH=uraka.db  # optional, defaults to uraka.db
DEMO_MODE=false  # optional, set to "true" to enable demo mode

Alternatively, you can set environment variables directly:

export TELEGRAM_BOT_TOKEN="your_bot_token_here"
export DATABASE_PATH="uraka.db"  # optional
export DEMO_MODE="true"  # optional
  1. Install dependencies:
go mod tidy
  1. Run the bot:
go run main.go

Usage

Normal Mode

The bot will automatically:

  • Start sending reminders at 9:00 AM Madrid time
  • Ask what you did every 15 minutes (language depends on your messages)
  • Save your responses
  • Stop when you send a stop word ("ложусь спать" or "going to sleep")

Language Support

The bot supports Russian and English. Language is detected automatically from your messages. Currently defaults to English, but you can extend it to store user preferences.

Commands

  • /start - Start the bot
  • /report - Generate report for tracking days (17.11, 18.11, 19.11)
    • If report is too long (>4000 chars), it will be published on Telegraph
    • If Telegraph fails, report will be sent as Markdown file
  • /demo - Activate demo mode (if DEMO_MODE=true)
  • /demo_next - Send next demo reminder (demo mode only)

Demo Mode

In demo mode (set DEMO_MODE=true):

  1. Send /demo to activate - bot sends first fake reminder
  2. Respond to the reminder with your activity
  3. Send /demo_next to trigger next reminder
  4. Respond again
  5. Send "ложусь спать" to end demo day
  6. Send /report to see the report

Example flow:

/demo
→ Bot: "🎭 Демо-режим активирован"
→ Bot: "Что ты делал последние 15 минут?"
You: "Работал над проектом"
→ Bot: "✓ Сохранено"
/demo_next
→ Bot: "Что ты делал последние 15 минут?"
You: "Читал документацию"
→ Bot: "✓ Сохранено"
You: "ложусь спать"
→ Bot: "Демо-день завершен. Используй /report для просмотра отчета."
/report
→ Bot: [shows formatted report]

Database Schema

  • activities - Stores user responses with timestamp
  • days - Tracks active tracking days

Development

Run tests:

go test ./...

License

Open source

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages