Skip to content

agalitsyn/vibecoder-heaven-tg-bot-go

Repository files navigation

Telegram Bot Template

Minimal Telegram bot template with user registration and SQLite storage. Built with Go and telegram-bot-api.

Features

  • /start command that registers users in local SQLite database
  • /status command showing bot version
  • Access control: public mode or allowlist by Telegram user ID
  • Automatic database migrations
  • Clean Architecture: repository pattern, dependency injection, interface-based design

Configuration

  1. Register a bot with BotFather and get a token
  2. Copy the config template and fill in your values:
    cp .env.example .env

Environment variables

Variable Description Default
TOKEN Telegram bot token (required)
DEBUG Enable debug logging false
PUBLIC Allow all users to use the bot true
ALLOWED_TG_IDS Comma-separated list of allowed Telegram user IDs (when PUBLIC=false)

When running outside of make, use the BOT_ prefix (e.g. BOT_TOKEN). Command-line flags (--token, --debug, etc.) override environment variables.

Running locally

make start

Development

make build        # build binary
make test         # run tests
make lint         # run linter
make fmt          # format code
make db-reset     # backup db and recreate with migrations
make db-migrate   # apply migrations only

Project structure

cmd/bot/           Application entry point and configuration
internal/
  app/             Bot logic and command handlers
  model/           Domain entities and repository interfaces
  storage/sqlite/  SQLite repository implementations
migrations/        SQL migration files
version/           Build version info

About

Vibe-code like you're in heaven

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors