Skip to content

ldmonster/tel-conf-bot

Repository files navigation

TelConfBot

A Telegram bot for tech conferences and expos. Manages attendee registration, interactive quizzes, merch distribution, feedback collection, and an admin panel — all configurable through a single YAML file.

Features

  • Registration — GDPR-compliant sign-up flow with role/grade selection
  • Virtual balance — Multi-currency point system (e.g. rubles, minutes) awarded for activities
  • Transactions — Admins credit/debit user balances with tracked descriptions
  • Merch store — Browse and purchase branded items using earned points
  • Quizzes — Multiple question sets with per-question scoring and flawless-run bonuses
  • Activities — Categorized list of stand activities (fun, practice, demos)
  • Feedback — Surveys with numeric, button-select, and free-text question types
  • About us — Company info, expert bios, talk schedule, vacancy links
  • Inline invites — Users can share a conference invitation via Telegram inline query
  • Admin panel — Transaction management, reports (Excel export), broadcast messaging, DB dump, registration toggle
  • Reports — Export all data (users, transactions, quizzes, feedback, metrics) to .xlsx

Quick Start

  1. Clone the repository
git clone https://github.com/ldmonster/tel-conf-bot.git
cd tel-conf-bot
  1. Create a .env file in the project root:
TELEGRAM_TOKEN=<your-bot-token>
LOG_LEVEL=INFO
  1. Edit .config.yaml to customize conference content (see Configuration)

  2. Run the bot

go run ./cmd/bot

The bot starts in long-polling mode. SQLite database is created automatically at tmp/gorm.db.

Configuration

Environment Variables

Variable Default Description
TELEGRAM_TOKEN empty Telegram Bot API token (required)
LOG_LEVEL INFO Logging level: DEBUG, INFO, ERROR
LOG_FILE_PATH logs/bot.log Path to the log file
STORAGE_SQLITE_DB_PATH tmp/gorm.db Path to the SQLite database file
CONFERENCE_CONFIG .config.yaml Path to the conference config (auto-detected)

Conference Config (.config.yaml)

All bot content is driven by a single YAML file. Key sections:

Section Description
mainPage Welcome text, registration flow, GDPR consent
companyRoles / companyGrades Selectable roles and grades during registration
startingBalance Points credited on sign-up (per currency)
merch Merch catalog with names, descriptions, images, and costs
transactions Predefined credit/debit descriptions and amounts for admin use
admin Admin registration command and access codes
quiz Question sets with numbered variant maps, correct answers, and scoring
activities Stand activities grouped by category
aboutUs Company info, expert list, talks, vacancy links
feedback Survey questions (numeric / button-select / free-text) with completion reward
inlineQuery Inline invite message text

Quiz variants use a numbered map format:

variants:
  1: First option
  2: Second option
  3: Third option
rightVariant: 2

Project Structure

cmd/bot/            Entry point, config loading, Telegram bot setup
internal/
  app/              Application services (registration, transactions, quiz, feedback, reports, admin)
  config/           Conference YAML config loader and validation
  domain/           Domain models and repository interfaces
    activity/       Stand activities
    admin/          Administrator model
    balance/        User balance (multi-currency)
    content/        UI content types (main page, about us, inline query)
    feedback/       Feedback config and model
    merch/          Merch catalog
    metric/         Button click metrics
    notification/   Broadcast notifications
    query/          Admin query queue
    quiz/           Quiz questions and results
    setting/        Key-value settings
    transaction/    Transaction model and config
    user/           User model, states, repository
  infra/sqlite/     SQLite repository implementations (GORM)
  telegram/
    middleware/     Auth and rate-limiting middleware
    presenter/      Message formatting helpers
    router/         Callback router with middleware support
    v1/             Telegram handlers (all bot commands and callbacks)
pkg/
  callback/         Callback data encoding/decoding
  logger/           Zap logger with file rotation

Build

# Local binary
make build

# Run tests
make test

# Lint
make lint

# Full CI check (lint + test + build)
make ci

Docker

docker build -t tel-conf-bot .
docker run --env-file .env -v $(pwd)/.config.yaml:/app/.config.yaml -v $(pwd)/images:/app/images tel-conf-bot

Admin Access

  1. Send the registration command (default: /reg) to the bot
  2. Enter the moderator code (configured in admin.register.code)
  3. To promote to full admin, use the promote code (admin.register.promouteCode)

Admin capabilities: manage transactions, view reports, broadcast messages, download the database, toggle admin registration.

License

Copyright 2026 TelConfBot Contributors

Licensed under the Apache License, Version 2.0. See LICENSE for details.

About

Telegram bot for conferences

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages